summaryrefslogtreecommitdiffstats
path: root/dom/canvas/WebGLExtensionDisjointTimerQuery.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dom/canvas/WebGLExtensionDisjointTimerQuery.cpp')
-rw-r--r--dom/canvas/WebGLExtensionDisjointTimerQuery.cpp42
1 files changed, 28 insertions, 14 deletions
diff --git a/dom/canvas/WebGLExtensionDisjointTimerQuery.cpp b/dom/canvas/WebGLExtensionDisjointTimerQuery.cpp
index e2e34f14e..da76eeb2d 100644
--- a/dom/canvas/WebGLExtensionDisjointTimerQuery.cpp
+++ b/dom/canvas/WebGLExtensionDisjointTimerQuery.cpp
@@ -40,8 +40,10 @@ void
WebGLExtensionDisjointTimerQuery::DeleteQueryEXT(WebGLQuery* query) const
{
const char funcName[] = "deleteQueryEXT";
- if (mIsLost)
- return;
+
+ if (mIsLost || !mContext) {
+ return;
+ }
mContext->DeleteQuery(query, funcName);
}
@@ -50,8 +52,10 @@ bool
WebGLExtensionDisjointTimerQuery::IsQueryEXT(const WebGLQuery* query) const
{
const char funcName[] = "isQueryEXT";
- if (mIsLost)
- return false;
+
+ if (mIsLost || !mContext) {
+ return false;
+ }
return mContext->IsQuery(query, funcName);
}
@@ -60,8 +64,10 @@ void
WebGLExtensionDisjointTimerQuery::BeginQueryEXT(GLenum target, WebGLQuery& query) const
{
const char funcName[] = "beginQueryEXT";
- if (mIsLost)
- return;
+
+ if (mIsLost || !mContext) {
+ return;
+ }
mContext->BeginQuery(target, query, funcName);
}
@@ -70,8 +76,10 @@ void
WebGLExtensionDisjointTimerQuery::EndQueryEXT(GLenum target) const
{
const char funcName[] = "endQueryEXT";
- if (mIsLost)
- return;
+
+ if (mIsLost || !mContext) {
+ return;
+ }
mContext->EndQuery(target, funcName);
}
@@ -80,8 +88,10 @@ void
WebGLExtensionDisjointTimerQuery::QueryCounterEXT(WebGLQuery& query, GLenum target) const
{
const char funcName[] = "queryCounterEXT";
- if (mIsLost)
- return;
+
+ if (mIsLost || !mContext) {
+ return;
+ }
if (!mContext->ValidateObject(funcName, query))
return;
@@ -95,8 +105,10 @@ WebGLExtensionDisjointTimerQuery::GetQueryEXT(JSContext* cx, GLenum target, GLen
{
const char funcName[] = "getQueryEXT";
retval.setNull();
- if (mIsLost)
- return;
+
+ if (mIsLost || !mContext) {
+ return;
+ }
mContext->GetQuery(cx, target, pname, retval, funcName);
}
@@ -108,8 +120,10 @@ WebGLExtensionDisjointTimerQuery::GetQueryObjectEXT(JSContext* cx,
{
const char funcName[] = "getQueryObjectEXT";
retval.setNull();
- if (mIsLost)
- return;
+
+ if (mIsLost || !mContext) {
+ return;
+ }
mContext->GetQueryParameter(cx, query, pname, retval, funcName);
}