Bug 1231832. Make IsActive work on Querys that have not begun. r=jgilbert
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Fri, 11 Dec 2015 10:12:18 -0500
changeset 276338 761059d108fc2b2d1e8c0a7c1ff36cbedb234a59
parent 276337 31ffab3a0629112c83681efc5f4bf05e5463584c
child 276339 55d6bbc66a2d87338afb98fc3d12b3dd08ef8150
push id69123
push userjmuizelaar@mozilla.com
push dateMon, 14 Dec 2015 18:54:43 +0000
treeherdermozilla-inbound@761059d108fc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgilbert
bugs1231832
milestone45.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1231832. Make IsActive work on Querys that have not begun. r=jgilbert This fixes deqp/functional/gles3/lifetime.html
dom/canvas/WebGLQuery.cpp
dom/canvas/WebGLQuery.h
--- a/dom/canvas/WebGLQuery.cpp
+++ b/dom/canvas/WebGLQuery.cpp
@@ -35,16 +35,19 @@ WebGLQuery::Delete()
     mContext->MakeContextCurrent();
     mContext->gl->fDeleteQueries(1, &mGLName);
     LinkedListElement<WebGLQuery>::removeFrom(mContext->mQueries);
 }
 
 bool
 WebGLQuery::IsActive() const
 {
+    if (!HasEverBeenActive())
+        return false;
+
     WebGLRefPtr<WebGLQuery>& targetSlot = mContext->GetQuerySlotByTarget(mType);
 
     return targetSlot.get() == this;
 }
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(WebGLQuery)
 
 NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(WebGLQuery, AddRef)
--- a/dom/canvas/WebGLQuery.h
+++ b/dom/canvas/WebGLQuery.h
@@ -19,17 +19,17 @@ class WebGLQuery final
     , public LinkedListElement<WebGLQuery>
     , public WebGLContextBoundObject
 {
 public:
     explicit WebGLQuery(WebGLContext* webgl);
 
     bool IsActive() const;
 
-    bool HasEverBeenActive() {
+    bool HasEverBeenActive() const {
         return mType != 0;
     }
 
     // WebGLRefCountedObject
     void Delete();
 
     // nsWrapperCache
     WebGLContext* GetParentObject() const {