Bug 594876 - Turn OpenGL compositing on by default on X11. r=joe
authorMatt Woodrow <mwoodrow@mozilla.com>
Sat, 20 Aug 2011 14:04:24 +1200
changeset 76080 0a920411e64c019db924a46ae617074f868df3b1
parent 76079 58147380793b71cadae0ed29930b30f4a76e135a
child 76081 70a6be6a9caaa6fcd351381429d4590d1849d83d
child 76089 7797172fc164f2f75bb739b47e99f1a5eaaa53a6
push idunknown
push userunknown
push dateunknown
reviewersjoe
bugs594876
milestone9.0a1
Bug 594876 - Turn OpenGL compositing on by default on X11. r=joe
gfx/tests/mochitest/test_acceleration.html
widget/src/xpwidgets/nsBaseWidget.cpp
--- a/gfx/tests/mochitest/test_acceleration.html
+++ b/gfx/tests/mochitest/test_acceleration.html
@@ -66,16 +66,20 @@ switch(osName)
       ok(!gfxInfo.D2DEnabled, "Direct2D not supported on Windows 2003 or older");
       ok(!gfxInfo.DWriteEnabled, "DirectWrite not supported on Windows 2003 or older");
     } else {
       ok(gfxInfo.D2DEnabled, "Direct2D enabled on Windows Vista or newer");
       ok(gfxInfo.DWriteEnabled, "DirectWrite enabled on Windows Vista or newer");
     }
     break;
 
+  case "Linux":
+    isnot(acceleratedWindows, 0, "Acceleration enabled on Linux");
+    break;
+
   default:
     is(acceleratedWindows, 0, "Acceleration not supported on '" + osName + "'");
 }
 
 </script>
 </pre>
 </body>
 </html>
--- a/widget/src/xpwidgets/nsBaseWidget.cpp
+++ b/widget/src/xpwidgets/nsBaseWidget.cpp
@@ -773,17 +773,17 @@ nsBaseWidget::AutoUseBasicLayerManager::
 nsBaseWidget::AutoUseBasicLayerManager::~AutoUseBasicLayerManager()
 {
   mWidget->mTemporarilyUseBasicLayerManager = PR_FALSE;
 }
 
 PRBool
 nsBaseWidget::GetShouldAccelerate()
 {
-#if defined(XP_WIN) || defined(ANDROID) || (MOZ_PLATFORM_MAEMO > 5)
+#if defined(XP_WIN) || defined(ANDROID) || (MOZ_PLATFORM_MAEMO > 5) || (!defined(MOZ_PLATFORM_MAEMO) && defined(MOZ_X11))
   PRBool accelerateByDefault = PR_TRUE;
 #elif defined(XP_MACOSX)
 /* quickdraw plugins don't work with OpenGL so we need to avoid OpenGL when we want to support
  * them. e.g. 10.5 */
 # if defined(NP_NO_QUICKDRAW)
   PRBool accelerateByDefault = PR_TRUE;
 
   // 10.6.2 and lower have a bug involving textures and pixel buffer objects