Backed out changeset cdc2bfed4faa (bug 1218881) for static build bustage CLOSED TREE
authorWes Kocher <wkocher@mozilla.com>
Fri, 18 Dec 2015 12:43:42 -0800
changeset 277070 dd319db81bb855825d851b344fd2da070f1a7e74
parent 277069 b9f3786d8f60b8ebffaa8f17a0fc0d338276168c
child 277071 cd6226b5ea820de6651baa1c3a66aac8359d275c
push id16724
push usercbook@mozilla.com
push dateMon, 21 Dec 2015 11:00:52 +0000
treeherderfx-team@3f3f0361567c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1218881
milestone46.0a1
backs outcdc2bfed4faad7297f1ccf100a62b859a301563f
Backed out changeset cdc2bfed4faa (bug 1218881) for static build bustage CLOSED TREE
dom/canvas/WebGL2ContextQueries.cpp
dom/canvas/WebGLQuery.cpp
dom/canvas/WebGLQuery.h
gfx/thebes/gfxPrefs.h
--- a/dom/canvas/WebGL2ContextQueries.cpp
+++ b/dom/canvas/WebGL2ContextQueries.cpp
@@ -1,18 +1,16 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "WebGL2Context.h"
 #include "GLContext.h"
 #include "WebGLQuery.h"
-#include "gfxPrefs.h"
-#include "nsThreadUtils.h"
 
 namespace mozilla {
 
 /*
  * We fake ANY_SAMPLES_PASSED and ANY_SAMPLES_PASSED_CONSERVATIVE with
  * SAMPLES_PASSED on desktop.
  *
  * OpenGL ES 3.0 spec 4.1.6:
@@ -252,17 +250,16 @@ WebGL2Context::EndQuery(GLenum target)
 
     if (target == LOCAL_GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN) {
         gl->fEndQuery(LOCAL_GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN);
     } else {
         gl->fEndQuery(SimulateOcclusionQueryTarget(gl, target));
     }
 
     UpdateBoundQuery(target, nullptr);
-    NS_DispatchToCurrentThread(new WebGLQuery::AvailableRunnable(activeQuery));
 }
 
 already_AddRefed<WebGLQuery>
 WebGL2Context::GetQuery(GLenum target, GLenum pname)
 {
     if (IsContextLost())
         return nullptr;
 
@@ -323,21 +320,16 @@ WebGL2Context::GetQueryParameter(JSConte
         /* See (spec getQueryObject 1)
          *     If this instance of WebGLQuery has never been active before, that
          *     mean that query->mGLName is not a query object yet.
          */
         ErrorInvalidOperation("getQueryObject: `query` has never been active.");
         return;
     }
 
-    // We must wait for an event loop before the query can be available
-    if (!query->mCanBeAvailable && !gfxPrefs::WebGLImmediateQueries()) {
-        return;
-    }
-
     MakeContextCurrent();
     GLuint returned = 0;
     switch (pname) {
     case LOCAL_GL_QUERY_RESULT_AVAILABLE:
         gl->fGetQueryObjectuiv(query->mGLName, LOCAL_GL_QUERY_RESULT_AVAILABLE, &returned);
         retval.set(JS::BooleanValue(returned != 0));
         return;
 
--- a/dom/canvas/WebGLQuery.cpp
+++ b/dom/canvas/WebGLQuery.cpp
@@ -15,17 +15,16 @@ namespace mozilla {
 JSObject*
 WebGLQuery::WrapObject(JSContext* cx, JS::Handle<JSObject*> givenProto)
 {
     return dom::WebGLQueryBinding::Wrap(cx, this, givenProto);
 }
 
 WebGLQuery::WebGLQuery(WebGLContext* webgl)
     : WebGLContextBoundObject(webgl)
-    , mCanBeAvailable(false)
     , mGLName(0)
     , mType(0)
 {
     mContext->mQueries.insertBack(this);
 
     mContext->MakeContextCurrent();
     mContext->gl->fGenQueries(1, &mGLName);
 }
--- a/dom/canvas/WebGLQuery.h
+++ b/dom/canvas/WebGLQuery.h
@@ -5,42 +5,28 @@
 
 #ifndef WEBGL_QUERY_H_
 #define WEBGL_QUERY_H_
 
 #include "mozilla/LinkedList.h"
 #include "nsWrapperCache.h"
 
 #include "WebGLObjectModel.h"
-#include "nsThreadUtils.h"
 
 namespace mozilla {
 
 class WebGLQuery final
     : public nsWrapperCache
     , public WebGLRefCountedObject<WebGLQuery>
     , public LinkedListElement<WebGLQuery>
     , public WebGLContextBoundObject
 {
 public:
     explicit WebGLQuery(WebGLContext* webgl);
 
-    class AvailableRunnable final : public nsRunnable
-    {
-    public:
-        AvailableRunnable(WebGLQuery* query) : mQuery(query) { }
-
-        NS_IMETHOD Run() override {
-            mQuery->mCanBeAvailable = true;
-            return NS_OK;
-        }
-    private:
-        const RefPtr<WebGLQuery> mQuery;
-    };
-
     bool IsActive() const;
 
     bool HasEverBeenActive() const {
         return mType != 0;
     }
 
     // WebGLRefCountedObject
     void Delete();
@@ -51,18 +37,16 @@ public:
     }
 
     // NS
     virtual JSObject* WrapObject(JSContext* cx, JS::Handle<JSObject*> givenProto) override;
 
     NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLQuery)
     NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLQuery)
 
-    // Track whether the event loop has spun
-    bool mCanBeAvailable;
 
 private:
     ~WebGLQuery() {
         DeleteOnce();
     };
 
     GLuint mGLName;
     GLenum mType;
--- a/gfx/thebes/gfxPrefs.h
+++ b/gfx/thebes/gfxPrefs.h
@@ -432,17 +432,16 @@ private:
   DECL_GFX_PREF(Live, "webgl.force-enabled",                   WebGLForceEnabled, bool, false);
   DECL_GFX_PREF(Once, "webgl.force-layers-readback",           WebGLForceLayersReadback, bool, false);
   DECL_GFX_PREF(Live, "webgl.lose-context-on-memory-pressure", WebGLLoseContextOnMemoryPressure, bool, false);
   DECL_GFX_PREF(Live, "webgl.max-warnings-per-context",        WebGLMaxWarningsPerContext, uint32_t, 32);
   DECL_GFX_PREF(Live, "webgl.min_capability_mode",             WebGLMinCapabilityMode, bool, false);
   DECL_GFX_PREF(Live, "webgl.msaa-force",                      WebGLForceMSAA, bool, false);
   DECL_GFX_PREF(Live, "webgl.prefer-16bpp",                    WebGLPrefer16bpp, bool, false);
   DECL_GFX_PREF(Live, "webgl.restore-context-when-visible",    WebGLRestoreWhenVisible, bool, true);
-  DECL_GFX_PREF(Live, "webgl.allow-immediate-queries",         WebGLImmediateQueries, bool, false);
 
   DECL_GFX_PREF(Live, "webgl.webgl2-compat-mode",              WebGL2CompatMode, bool, false);
 
   // WARNING:
   // Please make sure that you've added your new preference to the list above in alphabetical order.
   // Please do not just append it to the end of the list.
 
 public: