Bug 1285629 - Incorrect feature check for ogl on windows draft
authoreyim <eyim@mozilla.com>
Fri, 08 Jul 2016 15:18:47 -0400
changeset 385603 4da2d9a948211e6c6a471553e525f05a4f6cf9e2
parent 383613 f378a56b25ce2a2997b263c1857629f3f18d7400
child 524973 d733b8df8088064fcd14bb9eba750d252b9cc58c
push id22550
push userbmo:eyim@mozilla.com
push dateFri, 08 Jul 2016 19:19:22 +0000
bugs1285629
milestone50.0a1
Bug 1285629 - Incorrect feature check for ogl on windows MozReview-Commit-ID: ABphm17YWnH
gfx/thebes/gfxPlatform.cpp
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -2443,31 +2443,37 @@ void
 gfxPlatform::BumpDeviceCounter()
 {
   mDeviceCounter++;
 }
 
 void
 gfxPlatform::InitOpenGLConfig()
 {
+  #ifdef XP_WIN
+  // Don't enable by default on Windows, since it could show up in about:support even
+  // though it'll never get used. Only attempt if user enables the pref
+  if (!Preferences::GetBool("layers.prefer-opengl")){
+    return;
+  }
+  #endif
+
   FeatureState& openGLFeature = gfxConfig::GetFeature(Feature::OPENGL_COMPOSITING);
 
   // Check to see hw comp supported
   if (!gfxConfig::IsEnabled(Feature::HW_COMPOSITING)) {
     openGLFeature.DisableByDefault(FeatureStatus::Unavailable, "Hardware compositing is disabled",
                            NS_LITERAL_CSTRING("FEATURE_FAILURE_OPENGL_NEED_HWCOMP"));
     return;
   }
 
   #ifdef XP_WIN
-  // Don't enable by default on Windows, since it could show up in about:support even
-  // though it'll never get used.
   openGLFeature.SetDefaultFromPref(
     gfxPrefs::GetLayersPreferOpenGLPrefName(),
-    false,
+    true,
     gfxPrefs::GetLayersPreferOpenGLPrefDefault());
   #else
     openGLFeature.EnableByDefault();
   #endif
 
   nsCString message;
   nsCString failureId;
   if (!IsGfxInfoStatusOkay(nsIGfxInfo::FEATURE_OPENGL_LAYERS, &message, failureId)) {