Bug 829710 - Restore hardware-accleration check for 10.6.x, x <= 2, mistakenly removed in bug 598401. r=BenWa a=akeybl
authorJoe Drew <joe@drew.ca>
Mon, 14 Jan 2013 16:19:20 -0500
changeset 127125 dff581b63ec5864662b7327abdc97a2210511b81
parent 127124 b37131b881b60f5bd879e925c578be498713f68a
child 127126 a34152bf0975b57999ed61894f5f5391456ff9cf
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBenWa, akeybl
bugs829710, 598401
milestone20.0a2
Bug 829710 - Restore hardware-accleration check for 10.6.x, x <= 2, mistakenly removed in bug 598401. r=BenWa a=akeybl
widget/xpwidgets/nsBaseWidget.cpp
--- a/widget/xpwidgets/nsBaseWidget.cpp
+++ b/widget/xpwidgets/nsBaseWidget.cpp
@@ -772,16 +772,35 @@ nsBaseWidget::ComputeShouldAccelerate(bo
 {
 #if defined(XP_WIN) || defined(ANDROID) || (MOZ_PLATFORM_MAEMO > 5) || \
     defined(MOZ_GL_PROVIDER) || defined(XP_MACOSX)
   bool accelerateByDefault = true;
 #else
   bool accelerateByDefault = false;
 #endif
 
+#ifdef XP_MACOSX
+  // 10.6.2 and lower have a bug involving textures and pixel buffer objects
+  // that caused bug 629016, so we don't allow OpenGL-accelerated layers on
+  // those versions of the OS.
+  // This will still let full-screen video be accelerated on OpenGL, because
+  // that XUL widget opts in to acceleration, but that's probably OK.
+  SInt32 major, minor, bugfix;
+  OSErr err1 = ::Gestalt(gestaltSystemVersionMajor, &major);
+  OSErr err2 = ::Gestalt(gestaltSystemVersionMinor, &minor);
+  OSErr err3 = ::Gestalt(gestaltSystemVersionBugFix, &bugfix);
+  if (err1 == noErr && err2 == noErr && err3 == noErr) {
+    if (major == 10 && minor == 6) {
+      if (bugfix <= 2) {
+        accelerateByDefault = false;
+      }
+    }
+  }
+#endif
+
   // We don't want to accelerate small popup windows like menu, but we still
   // want to accelerate xul panels that may contain arbitrarily complex content.
   bool isSmallPopup = ((mWindowType == eWindowType_popup) &&
                       (mPopupType != ePopupTypePanel));
   // we should use AddBoolPrefVarCache
   bool disableAcceleration = isSmallPopup ||
     Preferences::GetBool("layers.acceleration.disabled", false);
   mForceLayersAcceleration =