Bug 1331066 - Use gfxVars instead of a compile-time flag for webrender-conditional code. r?sotaro draft
authorKartikaya Gupta <kgupta@mozilla.com>
Wed, 08 Feb 2017 16:15:27 -0500
changeset 480734 59880132e742615b5381659ff715b32ad88650c5
parent 480721 70c8970022b12beaeb458d7e02ca3cf05399160a
child 545043 475cf0357eaa23c53f8cfcc32ee947d6ffc80d1d
push id44643
push userkgupta@mozilla.com
push dateWed, 08 Feb 2017 21:16:16 +0000
reviewerssotaro
bugs1331066
milestone54.0a1
Bug 1331066 - Use gfxVars instead of a compile-time flag for webrender-conditional code. r?sotaro MozReview-Commit-ID: 1gQddJ8ruQB
gfx/gl/GLContextProviderWGL.cpp
--- a/gfx/gl/GLContextProviderWGL.cpp
+++ b/gfx/gl/GLContextProviderWGL.cpp
@@ -63,25 +63,17 @@ WGLLibrary::CreateDummyWindow(HDC* aWind
         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 = gfxVars::UseWebRender() ? 24 : 0;
         pfd.iLayerType = PFD_MAIN_PLANE;
 
         mWindowPixelFormat = ChoosePixelFormat(dc, &pfd);
     }
 
     if (!mWindowPixelFormat ||
         !SetPixelFormat(dc, mWindowPixelFormat, nullptr))
     {