Back out 4 csets from bug 1326421 because of various test failures. r=backout
authorKartikaya Gupta <kgupta@mozilla.com>
Fri, 13 Jan 2017 17:07:59 -0500
changeset 391072 384dac8cee40d43595b757da776f524ad0241217
parent 391071 3b8ff954dfba85fa10b3fbae674c902ada77bd74
child 391073 4328c358a7c1e7fbd9536a82a3372dc69fe10633
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout
bugs1326421
milestone53.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
Back out 4 csets from bug 1326421 because of various test failures. r=backout
dom/ipc/TabChild.cpp
dom/ipc/TabChild.h
gfx/gl/GLContextGLX.h
gfx/gl/GLContextProviderCGL.mm
gfx/gl/GLContextProviderEAGL.mm
gfx/gl/GLContextProviderEGL.cpp
gfx/gl/GLContextProviderGLX.cpp
gfx/gl/GLContextProviderImpl.h
gfx/gl/GLContextProviderNull.cpp
gfx/gl/GLContextProviderWGL.cpp
gfx/gl/GLLibraryEGL.cpp
gfx/ipc/CompositorOptions.h
gfx/ipc/GfxMessageUtils.h
gfx/layers/ipc/CompositorBridgeParent.cpp
gfx/thebes/gfxPlatform.cpp
gfx/thebes/gfxPlatformGtk.cpp
gfx/thebes/gfxPrefs.h
widget/PuppetWidget.cpp
widget/cocoa/nsChildView.mm
widget/nsBaseWidget.cpp
widget/windows/nsWindow.cpp
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -420,24 +420,16 @@ TabChild::TabChild(nsIContentChild* aMan
     }
   }
 
   for (uint32_t idx = 0; idx < NUMBER_OF_AUDIO_CHANNELS; idx++) {
     mAudioChannelsActive.AppendElement(false);
   }
 }
 
-const CompositorOptions&
-TabChild::GetCompositorOptions() const
-{
-  // If you're calling this before mCompositorOptions is set, well.. don't.
-  MOZ_ASSERT(mCompositorOptions);
-  return mCompositorOptions.ref();
-}
-
 bool
 TabChild::AsyncPanZoomEnabled() const
 {
   // If we have received the CompositorOptions we can answer definitively. If
   // not, return a best guess based on gfxPlaform values.
   return mCompositorOptions ? mCompositorOptions->UseAPZ()
                             : gfxPlatform::AsyncPanZoomEnabled();
 }
@@ -2314,42 +2306,36 @@ TabChild::RecvSetDocShellIsActive(const 
   // channel and the PContent channel, we have an ordering problem. This code
   // ensures that we respect the order in which the requests were made and
   // ignore stale requests.
   if (mLayerObserverEpoch >= aLayerObserverEpoch) {
     return IPC_OK();
   }
   mLayerObserverEpoch = aLayerObserverEpoch;
 
+  MOZ_ASSERT(mPuppetWidget);
+  MOZ_ASSERT(mPuppetWidget->GetLayerManager());
+  MOZ_ASSERT(mPuppetWidget->GetLayerManager()->GetBackendType() == LayersBackend::LAYERS_CLIENT
+          || mPuppetWidget->GetLayerManager()->GetBackendType() == LayersBackend::LAYERS_WR);
+
   auto clearForcePaint = MakeScopeExit([&] {
     // We might force a paint, or we might already have painted and this is a
     // no-op. In either case, once we exit this scope, we need to alert the
     // ProcessHangMonitor that we've finished responding to what might have
     // been a request to force paint. This is so that the BackgroundHangMonitor
     // for force painting can be made to wait again.
     if (aIsActive) {
       ProcessHangMonitor::ClearForcePaint();
     }
   });
 
-  if (mCompositorOptions) {
-    // Note that |GetLayerManager()| has side-effects in that it creates a layer
-    // manager if one doesn't exist already. Calling it inside a debug-only
-    // assertion is generally bad but in this case we call it unconditionally
-    // just below so it's ok.
-    MOZ_ASSERT(mPuppetWidget);
-    MOZ_ASSERT(mPuppetWidget->GetLayerManager());
-    MOZ_ASSERT(mPuppetWidget->GetLayerManager()->GetBackendType() == LayersBackend::LAYERS_CLIENT
-            || mPuppetWidget->GetLayerManager()->GetBackendType() == LayersBackend::LAYERS_WR);
-
-    // We send the current layer observer epoch to the compositor so that
-    // TabParent knows whether a layer update notification corresponds to the
-    // latest SetDocShellIsActive request that was made.
-    mPuppetWidget->GetLayerManager()->SetLayerObserverEpoch(aLayerObserverEpoch);
-  }
+  // We send the current layer observer epoch to the compositor so that
+  // TabParent knows whether a layer update notification corresponds to the
+  // latest SetDocShellIsActive request that was made.
+  mPuppetWidget->GetLayerManager()->SetLayerObserverEpoch(aLayerObserverEpoch);
 
   // docshell is consider prerendered only if not active yet
   mIsPrerendered &= !aIsActive;
   nsCOMPtr<nsIDocShell> docShell = do_GetInterface(WebNavigation());
   if (docShell) {
     bool wasActive;
     docShell->GetIsActive(&wasActive);
     if (aIsActive && wasActive) {
--- a/dom/ipc/TabChild.h
+++ b/dom/ipc/TabChild.h
@@ -613,17 +613,16 @@ public:
 
   bool IPCOpen() const { return mIPCOpen; }
 
   bool ParentIsActive() const
   {
     return mParentIsActive;
   }
 
-  const mozilla::layers::CompositorOptions& GetCompositorOptions() const;
   bool AsyncPanZoomEnabled() const;
 
   virtual ScreenIntSize GetInnerSize() override;
 
   // Call RecvShow(nsIntSize(0, 0)) and block future calls to RecvShow().
   void DoFakeShow(const TextureFactoryIdentifier& aTextureFactoryIdentifier,
                   const uint64_t& aLayersId,
                   PRenderFrameChild* aRenderFrame,
--- a/gfx/gl/GLContextGLX.h
+++ b/gfx/gl/GLContextGLX.h
@@ -29,18 +29,17 @@ public:
                     bool deleteDrawable,
                     gfxXlibSurface* pixmap = nullptr,
                     ContextProfile profile = ContextProfile::OpenGLCompatibility);
 
     // Finds a GLXFBConfig compatible with the provided window.
     static bool
     FindFBConfigForWindow(Display* display, int screen, Window window,
                           ScopedXFree<GLXFBConfig>* const out_scopedConfigArr,
-                          GLXFBConfig* const out_config, int* const out_visid,
-                          bool aWebRender);
+                          GLXFBConfig* const out_config, int* const out_visid);
 
     ~GLContextGLX();
 
     virtual GLContextType GetContextType() const override { return GLContextType::GLX; }
 
     static GLContextGLX* Cast(GLContext* gl) {
         MOZ_ASSERT(gl->GetContextType() == GLContextType::GLX);
         return static_cast<GLContextGLX*>(gl);
--- a/gfx/gl/GLContextProviderCGL.mm
+++ b/gfx/gl/GLContextProviderCGL.mm
@@ -8,17 +8,16 @@
 #include "nsDebug.h"
 #include "nsIWidget.h"
 #include <OpenGL/gl.h>
 #include "gfxFailure.h"
 #include "gfxPrefs.h"
 #include "prenv.h"
 #include "GeckoProfiler.h"
 #include "mozilla/gfx/MacIOSurface.h"
-#include "mozilla/layers/CompositorOptions.h"
 #include "mozilla/widget/CompositorWidget.h"
 
 #include <OpenGL/OpenGL.h>
 
 // When running inside a VM, creating an accelerated OpenGL context usually
 // fails. Uncomment this line to emulate that behavior.
 // #define EMULATE_VM
 
@@ -244,39 +243,35 @@ CreateWithFormat(const NSOpenGLPixelForm
     [format release];
 
     return context;
 }
 
 already_AddRefed<GLContext>
 GLContextProviderCGL::CreateForCompositorWidget(CompositorWidget* aCompositorWidget, bool aForceAccelerated)
 {
-    return CreateForWindow(aCompositorWidget->RealWidget(),
-                           aCompositorWidget->GetCompositorOptions().UseWebRender(),
-                           aForceAccelerated);
+    return CreateForWindow(aCompositorWidget->RealWidget(), aForceAccelerated);
 }
 
 already_AddRefed<GLContext>
-GLContextProviderCGL::CreateForWindow(nsIWidget* aWidget,
-                                      bool aWebRender,
-                                      bool aForceAccelerated)
+GLContextProviderCGL::CreateForWindow(nsIWidget* aWidget, bool aForceAccelerated)
 {
     if (!sCGLLibrary.EnsureInitialized()) {
         return nullptr;
     }
 
 #ifdef EMULATE_VM
     if (aForceAccelerated) {
         return nullptr;
     }
 #endif
 
     const NSOpenGLPixelFormatAttribute* attribs;
     if (sCGLLibrary.UseDoubleBufferedWindows()) {
-        if (aWebRender) {
+        if (gfxPrefs::WebRenderEnabled()) {
             attribs = aForceAccelerated ? kAttribs_doubleBuffered_accel_webrender : kAttribs_doubleBuffered;
         } else {
             attribs = aForceAccelerated ? kAttribs_doubleBuffered_accel : kAttribs_doubleBuffered;
         }
     } else {
         attribs = aForceAccelerated ? kAttribs_singleBuffered_accel : kAttribs_singleBuffered;
     }
     NSOpenGLContext* context = CreateWithFormat(attribs);
--- a/gfx/gl/GLContextProviderEAGL.mm
+++ b/gfx/gl/GLContextProviderEAGL.mm
@@ -6,17 +6,16 @@
 #include "GLContextProvider.h"
 #include "GLContextEAGL.h"
 #include "nsDebug.h"
 #include "nsIWidget.h"
 #include "gfxPrefs.h"
 #include "gfxFailure.h"
 #include "prenv.h"
 #include "mozilla/Preferences.h"
-#include "mozilla/layers/CompositorOptions.h"
 #include "mozilla/widget/CompositorWidget.h"
 #include "GeckoProfiler.h"
 
 #import <UIKit/UIKit.h>
 
 namespace mozilla {
 namespace gl {
 
@@ -206,25 +205,21 @@ CreateEAGLContext(CreateContextFlags fla
     }
 
     return glContext.forget();
 }
 
 already_AddRefed<GLContext>
 GLContextProviderEAGL::CreateForCompositorWidget(CompositorWidget* aCompositorWidget, bool aForceAccelerated)
 {
-    return CreateForWindow(aCompositorWidget->RealWidget(),
-                           aCompositorWidget->GetCompositorOptions().UseWebRender(),
-                           aForceAccelerated);
+    return CreateForWindow(aCompositorWidget->RealWidget(), aForceAccelerated);
 }
 
 already_AddRefed<GLContext>
-GLContextProviderEAGL::CreateForWindow(nsIWidget* aWidget,
-                                       bool aWebRender,
-                                       bool aForceAccelerated)
+GLContextProviderEAGL::CreateForWindow(nsIWidget* aWidget, bool aForceAccelerated)
 {
     RefPtr<GLContext> glContext = CreateEAGLContext(CreateContextFlags::NONE, false,
                                                     GetGlobalContextEAGL());
     if (!glContext) {
         return nullptr;
     }
 
     if (!GLContextEAGL::Cast(glContext)->AttachToWindow(aWidget)) {
--- a/gfx/gl/GLContextProviderEGL.cpp
+++ b/gfx/gl/GLContextProviderEGL.cpp
@@ -84,17 +84,16 @@
 #include "gfxPlatform.h"
 #include "gfxUtils.h"
 #include "GLBlitHelper.h"
 #include "GLContextEGL.h"
 #include "GLContextProvider.h"
 #include "GLLibraryEGL.h"
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/Preferences.h"
-#include "mozilla/layers/CompositorOptions.h"
 #include "mozilla/widget/CompositorWidget.h"
 #include "nsDebug.h"
 #include "nsIWidget.h"
 #include "nsThreadUtils.h"
 #include "ScopedGLHelpers.h"
 #include "TextureImageEGL.h"
 
 using namespace mozilla::gfx;
@@ -706,25 +705,21 @@ GLContextProviderEGL::CreateWrappingExis
     gl->mOwnsContext = false;
 
     return gl.forget();
 }
 
 already_AddRefed<GLContext>
 GLContextProviderEGL::CreateForCompositorWidget(CompositorWidget* aCompositorWidget, bool aForceAccelerated)
 {
-    return CreateForWindow(aCompositorWidget->RealWidget(),
-                           aCompositorWidget->GetCompositorOptions().UseWebRender(),
-                           aForceAccelerated);
+    return CreateForWindow(aCompositorWidget->RealWidget(), aForceAccelerated);
 }
 
 already_AddRefed<GLContext>
-GLContextProviderEGL::CreateForWindow(nsIWidget* aWidget,
-                                      bool aWebRender,
-                                      bool aForceAccelerated)
+GLContextProviderEGL::CreateForWindow(nsIWidget* aWidget, bool aForceAccelerated)
 {
     nsCString discardFailureId;
     if (!sEGLLibrary.EnsureInitialized(false, &discardFailureId)) {
         MOZ_CRASH("GFX: Failed to load EGL library 3!\n");
         return nullptr;
     }
 
     bool doubleBuffered = true;
@@ -737,17 +732,17 @@ GLContextProviderEGL::CreateForWindow(ns
 
     EGLSurface surface = mozilla::gl::CreateSurfaceForWindow(aWidget, config);
     if (!surface) {
         MOZ_CRASH("GFX: Failed to create EGLSurface!\n");
         return nullptr;
     }
 
     CreateContextFlags flags = CreateContextFlags::NONE;
-    if (aWebRender) {
+    if (gfxPrefs::WebRenderEnabled()) {
         flags |= CreateContextFlags::PREFER_ES3;
     }
     SurfaceCaps caps = SurfaceCaps::Any();
     RefPtr<GLContextEGL> gl = GLContextEGL::CreateGLContext(flags,
                                                             caps, nullptr, false, config,
                                                             surface, &discardFailureId);
     if (!gl) {
         MOZ_CRASH("GFX: Failed to create EGLContext!\n");
--- a/gfx/gl/GLContextProviderGLX.cpp
+++ b/gfx/gl/GLContextProviderGLX.cpp
@@ -10,17 +10,16 @@
 #endif
 
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
 #include "X11UndefineNone.h"
 
 #include "mozilla/MathAlgorithms.h"
 #include "mozilla/StaticPtr.h"
-#include "mozilla/layers/CompositorOptions.h"
 #include "mozilla/widget/CompositorWidget.h"
 #include "mozilla/widget/X11CompositorWidget.h"
 #include "mozilla/Unused.h"
 
 #include "prenv.h"
 #include "GLContextProvider.h"
 #include "GLLibraryLoader.h"
 #include "nsDebug.h"
@@ -1095,19 +1094,17 @@ GLContextProviderGLX::CreateWrappingExis
 
         return glContext.forget();
     }
 
     return nullptr;
 }
 
 already_AddRefed<GLContext>
-CreateForWidget(Display* aXDisplay, Window aXWindow,
-                bool aWebRender,
-                bool aForceAccelerated)
+CreateForWidget(Display* aXDisplay, Window aXWindow, bool aForceAccelerated)
 {
     if (!sGLXLibrary.EnsureInitialized()) {
         return nullptr;
     }
 
     // Currently, we take whatever Visual the window already has, and
     // try to create an fbconfig for that visual.  This isn't
     // necessarily what we want in the long run; an fbconfig may not
@@ -1121,25 +1118,25 @@ CreateForWidget(Display* aXDisplay, Wind
     }
 
     int xscreen = DefaultScreen(aXDisplay);
 
     ScopedXFree<GLXFBConfig> cfgs;
     GLXFBConfig config;
     int visid;
     if (!GLContextGLX::FindFBConfigForWindow(aXDisplay, xscreen, aXWindow, &cfgs,
-                                             &config, &visid, aWebRender))
+                                             &config, &visid))
     {
         return nullptr;
     }
 
     SurfaceCaps caps = SurfaceCaps::Any();
     GLContextGLX* shareContext = GetGlobalContextGLX();
     RefPtr<GLContextGLX> gl;
-    if (aWebRender) {
+    if (gfxPrefs::WebRenderEnabled()) {
       gl = GLContextGLX::CreateGLContext(CreateContextFlags::NONE,
                                          caps, shareContext, false,
                                          aXDisplay, aXWindow, config,
                                          //TODO: we might want to pass an additional bool to select GL core/compat
                                          false, nullptr, ContextProfile::OpenGLCore); //WR: required GL 3.2+
     } else {
       gl = GLContextGLX::CreateGLContext(CreateContextFlags::NONE,
                                          caps, shareContext, false,
@@ -1153,31 +1150,27 @@ CreateForWidget(Display* aXDisplay, Wind
 already_AddRefed<GLContext>
 GLContextProviderGLX::CreateForCompositorWidget(CompositorWidget* aCompositorWidget, bool aForceAccelerated)
 {
     X11CompositorWidget* compWidget = aCompositorWidget->AsX11();
     MOZ_ASSERT(compWidget);
 
     return CreateForWidget(compWidget->XDisplay(),
                            compWidget->XWindow(),
-                           compWidget->GetCompositorOptions().UseWebRender(),
                            aForceAccelerated);
 }
 
 already_AddRefed<GLContext>
-GLContextProviderGLX::CreateForWindow(nsIWidget* aWidget,
-                                      bool aWebRender,
-                                      bool aForceAccelerated)
+GLContextProviderGLX::CreateForWindow(nsIWidget* aWidget, bool aForceAccelerated)
 {
     Display* display = (Display*)aWidget->GetNativeData(NS_NATIVE_COMPOSITOR_DISPLAY);
     Window window = GET_NATIVE_WINDOW(aWidget);
 
     return CreateForWidget(display,
                            window,
-                           aWebRender,
                            aForceAccelerated);
 }
 
 static bool
 ChooseConfig(GLXLibrary* glx, Display* display, int screen, const SurfaceCaps& minCaps,
              ScopedXFree<GLXFBConfig>* const out_scopedConfigArr,
              GLXFBConfig* const out_config, int* const out_visid)
 {
@@ -1231,34 +1224,33 @@ ChooseConfig(GLXLibrary* glx, Display* d
     }
 
     return false;
 }
 
 bool
 GLContextGLX::FindFBConfigForWindow(Display* display, int screen, Window window,
                                     ScopedXFree<GLXFBConfig>* const out_scopedConfigArr,
-                                    GLXFBConfig* const out_config, int* const out_visid,
-                                    bool aWebRender)
+                                    GLXFBConfig* const out_config, int* const out_visid)
 {
     ScopedXFree<GLXFBConfig>& cfgs = *out_scopedConfigArr;
     int numConfigs;
     if (sGLXLibrary.IsATI() ||
         !sGLXLibrary.GLXVersionCheck(1, 3)) {
         const int attribs[] = {
             LOCAL_GLX_DOUBLEBUFFER, False,
             0
         };
         const int webrenderAttribs[] = {
             LOCAL_GLX_DOUBLEBUFFER, False,
             LOCAL_GLX_DEPTH_SIZE, 24,
             0
         };
 
-        if (aWebRender) {
+        if (gfxPrefs::WebRenderEnabled()) {
           cfgs = sGLXLibrary.xChooseFBConfig(display,
                                              screen,
                                              webrenderAttribs,
                                              &numConfigs);
         } else {
           cfgs = sGLXLibrary.xChooseFBConfig(display,
                                              screen,
                                              attribs,
@@ -1266,17 +1258,17 @@ GLContextGLX::FindFBConfigForWindow(Disp
         }
     } else {
         const int webrenderAttribs[] = {
             LOCAL_GLX_DEPTH_SIZE, 24,
             LOCAL_GLX_DOUBLEBUFFER, True,
             0
         };
 
-        if (aWebRender) {
+        if (gfxPrefs::WebRenderEnabled()) {
           cfgs = sGLXLibrary.xChooseFBConfig(display,
                                              screen,
                                              webrenderAttribs,
                                              &numConfigs);
         } else {
           cfgs = sGLXLibrary.xGetFBConfigs(display,
                                            screen,
                                            &numConfigs);
@@ -1297,17 +1289,17 @@ GLContextGLX::FindFBConfigForWindow(Disp
         NS_WARNING("[GLX] XGetWindowAttributes() failed");
         return false;
     }
     const VisualID windowVisualID = XVisualIDFromVisual(windowAttrs.visual);
 #ifdef DEBUG
     printf("[GLX] window %lx has VisualID 0x%lx\n", window, windowVisualID);
 #endif
 
-    if (aWebRender) {
+    if (gfxPrefs::WebRenderEnabled()) {
         for (int i = 0; i < numConfigs; i++) {
             int visid = X11None;
             sGLXLibrary.xGetFBConfigAttrib(display, cfgs[i], LOCAL_GLX_VISUAL_ID, &visid);
             if (!visid) {
                 continue;
             }
 
             int depth;
--- a/gfx/gl/GLContextProviderImpl.h
+++ b/gfx/gl/GLContextProviderImpl.h
@@ -56,23 +56,22 @@ public:
      * The GetSharedContext() method will return non-null if sharing
      * was successful.
      *
      * Note: a context created for a widget /must not/ hold a strong
      * reference to the widget; otherwise a cycle can be created through
      * a GL layer manager.
      *
      * @param aWidget Widget whose surface to create a context for
-     * @param aWebRender If the compositor is a WebRender compositor
      * @param aForceAccelerated true if only accelerated contexts are allowed
      *
      * @return Context to use for the window
      */
     static already_AddRefed<GLContext>
-    CreateForWindow(nsIWidget* aWidget, bool aWebRender, bool aForceAccelerated);
+    CreateForWindow(nsIWidget* aWidget, bool aForceAccelerated);
 
     /**
      * Create a context for offscreen rendering.  The target of this
      * context should be treated as opaque -- it might be a FBO, or a
      * pbuffer, or some other construct.  Users of this GLContext
      * should bind framebuffer 0 directly to use this offscreen buffer.
      *
      * The offscreen context returned by this method will always have
--- a/gfx/gl/GLContextProviderNull.cpp
+++ b/gfx/gl/GLContextProviderNull.cpp
@@ -12,19 +12,17 @@ using namespace mozilla::widget;
 
 already_AddRefed<GLContext>
 GLContextProviderNull::CreateForCompositorWidget(CompositorWidget* aCompositorWidget, bool aForceAccelerated)
 {
     return nullptr;
 }
 
 already_AddRefed<GLContext>
-GLContextProviderNull::CreateForWindow(nsIWidget* aWidget,
-                                       bool aWebRender,
-                                       bool aForceAccelerated)
+GLContextProviderNull::CreateForWindow(nsIWidget* aWidget, bool aForceAccelerated)
 {
     return nullptr;
 }
 
 already_AddRefed<GLContext>
 GLContextProviderNull::CreateWrappingExisting(void*, void*)
 {
     return nullptr;
--- a/gfx/gl/GLContextProviderWGL.cpp
+++ b/gfx/gl/GLContextProviderWGL.cpp
@@ -13,17 +13,16 @@
 
 #include "gfxCrashReporterUtils.h"
 
 #include "prenv.h"
 
 #include "mozilla/gfx/gfxVars.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/StaticPtr.h"
-#include "mozilla/layers/CompositorOptions.h"
 #include "mozilla/widget/CompositorWidget.h"
 
 namespace mozilla {
 namespace gl {
 
 using namespace mozilla::gfx;
 using namespace mozilla::widget;
 
@@ -51,36 +50,33 @@ WGLLibrary::CreateDummyWindow(HDC* aWind
                              nullptr, nullptr, GetModuleHandle(nullptr),
                              nullptr);
     NS_ENSURE_TRUE(win, nullptr);
 
     HDC dc = GetDC(win);
     NS_ENSURE_TRUE(dc, nullptr);
 
     if (mWindowPixelFormat == 0) {
+        int depthBits = 0;
+        if (gfxPrefs::WebRenderEnabled()) {
+          depthBits = 24;
+        }
+
         PIXELFORMATDESCRIPTOR pfd;
         ZeroMemory(&pfd, sizeof(PIXELFORMATDESCRIPTOR));
         pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR);
         pfd.nVersion = 1;
         pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
         pfd.iPixelType = PFD_TYPE_RGBA;
         pfd.cColorBits = 24;
         pfd.cRedBits = 8;
         pfd.cGreenBits = 8;
         pfd.cBlueBits = 8;
         pfd.cAlphaBits = 8;
-#ifdef MOZ_ENABLE_WEBRENDER
-        // XXX We might need to set this to 0 if the compositor that requires
-        // this context is not a WebRender compositor. Getting the
-        // CompositorOptions here is nontrivial though so for now we just use
-        // the ifdef guard.
-        pfd.cDepthBits = 24;
-#else
-        pfd.cDepthBits = 0;
-#endif
+        pfd.cDepthBits = depthBits;
         pfd.iLayerType = PFD_MAIN_PLANE;
 
         mWindowPixelFormat = ChoosePixelFormat(dc, &pfd);
     }
 
     if (!mWindowPixelFormat ||
         !SetPixelFormat(dc, mWindowPixelFormat, nullptr))
     {
@@ -440,25 +436,21 @@ already_AddRefed<GLContext>
 GLContextProviderWGL::CreateWrappingExisting(void*, void*)
 {
     return nullptr;
 }
 
 already_AddRefed<GLContext>
 GLContextProviderWGL::CreateForCompositorWidget(CompositorWidget* aCompositorWidget, bool aForceAccelerated)
 {
-    return CreateForWindow(aCompositorWidget->RealWidget(),
-                           aCompositorWidget->GetCompositorOptions().UseWebRender(),
-                           aForceAccelerated);
+    return CreateForWindow(aCompositorWidget->RealWidget(), aForceAccelerated);
 }
 
 already_AddRefed<GLContext>
-GLContextProviderWGL::CreateForWindow(nsIWidget* aWidget,
-                                      bool aWebRender,
-                                      bool aForceAccelerated)
+GLContextProviderWGL::CreateForWindow(nsIWidget* aWidget, bool aForceAccelerated)
 {
     if (!sWGLLib.EnsureInitialized()) {
         return nullptr;
     }
 
     /**
        * We need to make sure we call SetPixelFormat -after- calling
        * EnsureInitialized, otherwise it can load/unload the dll and
--- a/gfx/gl/GLLibraryEGL.cpp
+++ b/gfx/gl/GLLibraryEGL.cpp
@@ -145,21 +145,17 @@ GetAndInitWARPDisplay(GLLibraryEGL& egl,
     return display;
 }
 
 static bool
 IsAccelAngleSupported(const nsCOMPtr<nsIGfxInfo>& gfxInfo,
                       nsACString* const out_failureId)
 {
     if (CompositorThreadHolder::IsInCompositorThread()) {
-        // We can only enter here with WebRender, so assert that this is a
-        // WebRender-enabled build.
-#ifndef MOZ_ENABLE_WEBRENDER
-        MOZ_ASSERT(false);
-#endif
+        MOZ_ASSERT(gfxPrefs::WebRenderEnabled());
         return true;
     }
     int32_t angleSupport;
     nsCString failureId;
     gfxUtils::ThreadSafeGetFeatureStatus(gfxInfo,
                                          nsIGfxInfo::FEATURE_WEBGL_ANGLE,
                                          failureId,
                                          &angleSupport);
--- a/gfx/ipc/CompositorOptions.h
+++ b/gfx/ipc/CompositorOptions.h
@@ -26,35 +26,30 @@ namespace layers {
  * and are accessible to content processes over PCompositorBridge as well.
  */
 class CompositorOptions
 {
 public:
   // This constructor needed for IPDL purposes, don't use it anywhere else.
   CompositorOptions()
     : mUseAPZ(false)
-    , mUseWebRender(false)
   {
   }
 
-  explicit CompositorOptions(bool aUseAPZ,
-                             bool aUseWebRender)
+  explicit CompositorOptions(bool aUseAPZ)
     : mUseAPZ(aUseAPZ)
-    , mUseWebRender(aUseWebRender)
   {
   }
 
   bool UseAPZ() const { return mUseAPZ; }
-  bool UseWebRender() const { return mUseWebRender; }
 
   friend struct IPC::ParamTraits<CompositorOptions>;
 
 private:
   bool mUseAPZ;
-  bool mUseWebRender;
 
   // Make sure to add new fields to the ParamTraits implementation
 };
 
 } // namespace layers
 } // namespace mozilla
 
 #endif // _include_mozilla_gfx_ipc_CompositorOptions_h_
--- a/gfx/ipc/GfxMessageUtils.h
+++ b/gfx/ipc/GfxMessageUtils.h
@@ -1321,20 +1321,18 @@ struct ParamTraits<mozilla::Array<T, Len
 
 template <>
 struct ParamTraits<mozilla::layers::CompositorOptions>
 {
   typedef mozilla::layers::CompositorOptions paramType;
 
   static void Write(Message* aMsg, const paramType& aParam) {
     WriteParam(aMsg, aParam.mUseAPZ);
-    WriteParam(aMsg, aParam.mUseWebRender);
   }
 
   static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult) {
-    return ReadParam(aMsg, aIter, &aResult->mUseAPZ)
-        && ReadParam(aMsg, aIter, &aResult->mUseWebRender);
+    return ReadParam(aMsg, aIter, &aResult->mUseAPZ);
   }
 };
 
 } /* namespace IPC */
 
 #endif /* __GFXMESSAGEUTILS_H__ */
--- a/gfx/layers/ipc/CompositorBridgeParent.cpp
+++ b/gfx/layers/ipc/CompositorBridgeParent.cpp
@@ -385,17 +385,17 @@ CompositorBridgeParent::Initialize()
 
   { // scope lock
     MonitorAutoLock lock(*sIndirectLayerTreesLock);
     sIndirectLayerTrees[mRootLayerTreeID].mParent = this;
   }
 
   LayerScope::SetPixelScale(mScale.scale);
 
-  if (!mOptions.UseWebRender()) {
+  if (!gfxPrefs::WebRenderEnabled()) {
     mCompositorScheduler = new CompositorVsyncScheduler(this, mWidget);
   }
 }
 
 mozilla::ipc::IPCResult
 CompositorBridgeParent::RecvReset(nsTArray<LayersBackend>&& aBackendHints,
                                   const uint64_t& aSeqNo,
                                   bool* aResult,
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -935,19 +935,19 @@ gfxPlatform::InitLayersIPC()
 {
     if (sLayersIPCIsUp) {
       return;
     }
     sLayersIPCIsUp = true;
 
     if (XRE_IsParentProcess())
     {
-#ifdef MOZ_ENABLE_WEBRENDER
-        RenderThread::Start();
-#endif
+        if (gfxPrefs::WebRenderEnabled()) {
+            RenderThread::Start();
+        }
         layers::CompositorThreadHolder::Start();
     }
 }
 
 /* static */ void
 gfxPlatform::ShutdownLayersIPC()
 {
     if (!sLayersIPCIsUp) {
@@ -964,19 +964,19 @@ gfxPlatform::ShutdownLayersIPC()
         }
     } else if (XRE_IsParentProcess()) {
         gfx::VRManagerChild::ShutDown();
         layers::CompositorBridgeChild::ShutDown();
         layers::ImageBridgeChild::ShutDown();
 
         // This has to happen after shutting down the child protocols.
         layers::CompositorThreadHolder::Shutdown();
-#ifdef MOZ_ENABLE_WEBRENDER
-        RenderThread::ShutDown();
-#endif
+        if (gfxPrefs::WebRenderEnabled()) {
+            RenderThread::ShutDown();
+        }
     } else {
       // TODO: There are other kind of processes and we should make sure gfx
       // stuff is either not created there or shut down properly.
     }
 }
 
 void
 gfxPlatform::WillShutdown()
@@ -2218,22 +2218,20 @@ void
 gfxPlatform::InitGPUProcessPrefs()
 {
   // We want to hide this from about:support, so only set a default if the
   // pref is known to be true.
   if (!gfxPrefs::GPUProcessDevEnabled() && !gfxPrefs::GPUProcessDevForceEnabled()) {
     return;
   }
 
-#ifdef MOZ_ENABLE_WEBRENDER
-  // XXX disable GPU proces when webrender is enabled for now. See bug 1321527.
-  if (true) {
+  // XXX disable GPU proces when webrender is enabled for now.
+  if (gfxPrefs::WebRenderEnabled()) {
     return;
   }
-#endif
 
   FeatureState& gpuProc = gfxConfig::GetFeature(Feature::GPU_PROCESS);
 
   gpuProc.SetDefaultFromPref(
     gfxPrefs::GetGPUProcessDevEnabledPrefName(),
     true,
     gfxPrefs::GetGPUProcessDevEnabledPrefDefault());
 
@@ -2463,16 +2461,22 @@ gfxPlatform::AsyncPanZoomEnabled()
 #if !defined(MOZ_WIDGET_ANDROID) && !defined(MOZ_WIDGET_UIKIT)
   // For XUL applications (everything but Firefox on Android)
   // we only want to use APZ when E10S is enabled. If
   // we ever get input events off the main thread we can consider relaxing
   // this requirement.
   if (!BrowserTabsRemoteAutostart()) {
     return false;
   }
+#ifdef MOZ_ENABLE_WEBRENDER
+  // For webrender hacking we have a special pref to disable APZ even with e10s
+  if (gfxPrefs::WebRenderEnabled() && !gfxPrefs::APZAllowWithWebRender()) {
+    return false;
+  }
+#endif // MOZ_ENABLE_WEBRENDER
 #endif
 #ifdef MOZ_WIDGET_ANDROID
   return true;
 #else
   return gfxPrefs::AsyncPanZoomEnabledDoNotUseDirectly();
 #endif
 }
 
--- a/gfx/thebes/gfxPlatformGtk.cpp
+++ b/gfx/thebes/gfxPlatformGtk.cpp
@@ -730,20 +730,18 @@ public:
 
         // Most compositors wait for vsync events on the root window.
         Window root = DefaultRootWindow(mXDisplay);
         int screen = DefaultScreen(mXDisplay);
 
         ScopedXFree<GLXFBConfig> cfgs;
         GLXFBConfig config;
         int visid;
-        bool forWebRender = false;
         if (!gl::GLContextGLX::FindFBConfigForWindow(mXDisplay, screen, root,
-                                                     &cfgs, &config, &visid,
-                                                     forWebRender)) {
+                                                     &cfgs, &config, &visid)) {
           lock.NotifyAll();
           return;
         }
 
         mGLContext = gl::GLContextGLX::CreateGLContext(
             gl::CreateContextFlags::NONE,
             gl::SurfaceCaps::Any(),
             nullptr,
--- a/gfx/thebes/gfxPrefs.h
+++ b/gfx/thebes/gfxPrefs.h
@@ -421,20 +421,20 @@ private:
   DECL_GFX_PREF(Once, "gfx.vr.openvr-runtime",                 VROpenVRRuntime, std::string, "");
   DECL_GFX_PREF(Live, "gfx.vsync.collect-scroll-transforms",   CollectScrollTransforms, bool, false);
   DECL_GFX_PREF(Once, "gfx.vsync.compositor.unobserve-count",  CompositorUnobserveCount, int32_t, 10);
   DECL_GFX_PREF(Live, "gfx.webrender.profiler.enable",         WebRenderProfilerEnabled, bool, false);
   // Use vsync events generated by hardware
   DECL_GFX_PREF(Once, "gfx.work-around-driver-bugs",           WorkAroundDriverBugs, bool, true);
   DECL_GFX_PREF(Once, "gfx.screen-mirroring.enabled",          ScreenMirroringEnabled, bool, false);
 #ifdef MOZ_ENABLE_WEBRENDER
-  DECL_GFX_PREF(Live, "gfx.webrender.enabled",                 WebRenderEnabledDoNotUseDirectly, bool, false);
+  DECL_GFX_PREF(Once, "gfx.webrender.enabled",                 WebRenderEnabled, bool, false);
 #else
 public:
-  static bool WebRenderEnabledDoNotUseDirectly() { return false; }
+  static bool WebRenderEnabled() { return false; }
 private:
 #endif
 
   DECL_GFX_PREF(Live, "gl.ignore-dx-interop2-blacklist",       IgnoreDXInterop2Blacklist, bool, false);
   DECL_GFX_PREF(Live, "gl.msaa-level",                         MSAALevel, uint32_t, 2);
 #if defined(XP_MACOSX)
   DECL_GFX_PREF(Live, "gl.multithreaded",                      GLMultithreaded, bool, false);
 #endif
--- a/widget/PuppetWidget.cpp
+++ b/widget/PuppetWidget.cpp
@@ -580,33 +580,33 @@ PuppetWidget::ExecuteNativeKeyBinding(Na
 }
 
 LayerManager*
 PuppetWidget::GetLayerManager(PLayerTransactionChild* aShadowManager,
                               LayersBackend aBackendHint,
                               LayerManagerPersistence aPersistence)
 {
   if (!mLayerManager) {
-    if (mTabChild->GetCompositorOptions().UseWebRender()) {
+    if (gfxPrefs::WebRenderEnabled()) {
       mLayerManager = new WebRenderLayerManager(this);
     } else {
       mLayerManager = new ClientLayerManager(this);
     }
   }
   ShadowLayerForwarder* lf = mLayerManager->AsShadowForwarder();
   if (lf && !lf->HasShadowManager() && aShadowManager) {
     lf->SetShadowManager(aShadowManager);
   }
   return mLayerManager;
 }
 
 LayerManager*
 PuppetWidget::RecreateLayerManager(PLayerTransactionChild* aShadowManager)
 {
-  if (mTabChild->GetCompositorOptions().UseWebRender()) {
+  if (gfxPrefs::WebRenderEnabled()) {
     mLayerManager = new WebRenderLayerManager(this);
   } else {
     mLayerManager = new ClientLayerManager(this);
   }
   if (ShadowLayerForwarder* lf = mLayerManager->AsShadowForwarder()) {
     lf->SetShadowManager(aShadowManager);
   }
   return mLayerManager;
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -274,17 +274,17 @@ namespace {
 // deadlocks in our setup. See bug 882523.
 class GLPresenter : public GLManager
 {
 public:
   static mozilla::UniquePtr<GLPresenter> CreateForWindow(nsIWidget* aWindow)
   {
     // Contrary to CompositorOGL, we allow unaccelerated OpenGL contexts to be
     // used. BasicCompositor only requires very basic GL functionality.
-    RefPtr<GLContext> context = gl::GLContextProvider::CreateForWindow(aWindow, false, false);
+    RefPtr<GLContext> context = gl::GLContextProvider::CreateForWindow(aWindow, false);
     return context ? MakeUnique<GLPresenter>(context) : nullptr;
   }
 
   explicit GLPresenter(GLContext* aContext);
   virtual ~GLPresenter();
 
   virtual GLContext* gl() const override { return mGLContext; }
   virtual ShaderProgramOGL* GetProgram(GLenum aTarget, gfx::SurfaceFormat aFormat) override
--- a/widget/nsBaseWidget.cpp
+++ b/widget/nsBaseWidget.cpp
@@ -1293,36 +1293,25 @@ void nsBaseWidget::CreateCompositor(int 
   // If we've already received a shutdown notification, don't try
   // create a new compositor.
   if (!mShutdownObserver) {
     return;
   }
 
   CreateCompositorVsyncDispatcher();
 
-  // For now we decide whether or not to enable WR on this widget by the current
-  // value of the pref (this is the only place in the code allowed to check the
-  // value of the pref). We might want to change this eventually and drop the
-  // pref entirely.
-  bool enableWR = gfxPrefs::WebRenderEnabledDoNotUseDirectly();
-  bool enableAPZ = UseAPZ();
-  if (enableWR && !gfxPrefs::APZAllowWithWebRender()) {
-    // Disable APZ on widgets using WebRender, since it doesn't work yet. Allow
-    // it on non-WR widgets or if the pref forces it on.
-    enableAPZ = false;
-  }
-  CompositorOptions options(enableAPZ, enableWR);
-
   RefPtr<LayerManager> lm;
-  if (options.UseWebRender()) {
+  if (gfxPrefs::WebRenderEnabled()) {
     lm = new WebRenderLayerManager(this);
   } else {
     lm = new ClientLayerManager(this);
   }
 
+  CompositorOptions options(UseAPZ());
+
   gfx::GPUProcessManager* gpu = gfx::GPUProcessManager::Get();
   mCompositorSession = gpu->CreateTopLevelCompositor(
     this,
     lm,
     GetDefaultScale(),
     options,
     UseExternalCompositingSurface(),
     gfx::IntSize(aWidth, aHeight));
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -3905,17 +3905,17 @@ nsWindow::GetLayerManager(PLayerTransact
 
     // Ensure we have a widget proxy even if we're not using the compositor,
     // since all our transparent window handling lives there.
     CompositorWidgetInitData initData(
       reinterpret_cast<uintptr_t>(mWnd),
       reinterpret_cast<uintptr_t>(static_cast<nsIWidget*>(this)),
       mTransparencyMode);
     // If we're not using the compositor, the options don't actually matter.
-    CompositorOptions options(false, false);
+    CompositorOptions options(false);
     mBasicLayersSurface = new InProcessWinCompositorWidget(initData, options, this);
     mCompositorWidgetDelegate = mBasicLayersSurface;
     mLayerManager = CreateBasicLayerManager();
   }
 
   NS_ASSERTION(mLayerManager, "Couldn't provide a valid layer manager.");
 
   return mLayerManager;