Пример #1
0
void WebGLContext::GetQueryParameter(JSContext*, const WebGLQuery& query,
                                     GLenum pname,
                                     JS::MutableHandleValue retval) {
  const FuncScope funcScope(*this, "getQueryParameter");
  retval.setNull();
  if (IsContextLost()) return;

  if (!ValidateObject("query", query)) return;

  query.GetQueryParameter(pname, retval);
}
Пример #2
0
void WebGLContext::BeginQuery(GLenum target, WebGLQuery& query) {
  const FuncScope funcScope(*this, "beginQuery");
  if (IsContextLost()) return;

  if (!ValidateObject("query", query)) return;

  const auto& slot = ValidateQuerySlotByTarget(target);
  if (!slot) return;

  if (*slot) return ErrorInvalidOperation("Query target already active.");

  ////

  query.BeginQuery(target, *slot);
}
Пример #3
0
void
WebGLContext::GetQueryParameter(JSContext*, const WebGLQuery& query, GLenum pname,
                                JS::MutableHandleValue retval, const char* funcName)
{
    if (!funcName) {
        funcName = "getQueryParameter";
    }

    retval.setNull();
    if (IsContextLost())
        return;

    if (!ValidateObject(funcName, query))
        return;

    query.GetQueryParameter(pname, retval);
}
Пример #4
0
void
WebGLContext::BeginQuery(GLenum target, WebGLQuery& query, const char* funcName)
{
    if (!funcName) {
        funcName = "beginQuery";
    }

    if (IsContextLost())
        return;

    if (!ValidateObject(funcName, query))
        return;

    const auto& slot = ValidateQuerySlotByTarget(funcName, target);
    if (!slot)
        return;

    if (*slot)
        return ErrorInvalidOperation("%s: Query target already active.", funcName);

    ////

    query.BeginQuery(target, *slot);
}