merging in my changes because people are pushing like mad
authorBoris Zbarsky <bzbarsky@mit.edu>
Wed, 12 May 2010 15:04:05 -0400
changeset 42230 0e4dbff3db1831c1fb2906443d740c9a9f5fe05a
parent 42229 71b412c3b11d47775ba66410bee81e04728e9a13 (current diff)
parent 42226 acfdd4976458df4ae62979822530bad9fc17cc38 (diff)
child 42231 a93160d1e4428278c7d20171eafec8e265da05ca
push idunknown
push userunknown
push dateunknown
milestone1.9.3a5pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
merging in my changes because people are pushing like mad
--- a/modules/libpref/src/init/all.js
+++ b/modules/libpref/src/init/all.js
@@ -2803,16 +2803,19 @@ pref("network.tcp.sendbuffer", 131072);
 #ifdef WINCE
 pref("mozilla.widget.disable-native-theme", true);
 pref("gfx.color_management.mode", 0);
 #endif
 
 // Initialize default render-mode.
 pref("mozilla.widget.render-mode", -1);
 
+// Initialize default accelerated layers
+pref("mozilla.widget.accelerated-layers", true);
+
 // Enable/Disable the geolocation API for content
 pref("geo.enabled", true);
 
 // Enable/Disable the orientation API for content
 pref("accelerometer.enabled", true);
 
 // Enable/Disable HTML5 parser
 pref("html5.enable", true);
--- a/widget/src/xpwidgets/nsBaseWidget.cpp
+++ b/widget/src/xpwidgets/nsBaseWidget.cpp
@@ -656,17 +656,25 @@ nsBaseWidget::AutoLayerManagerSetup::~Au
       "AutoLayerManagerSetup instantiated for non-basic layer backend!");
     manager->SetDefaultTarget(nsnull);
   }
 }
 
 LayerManager* nsBaseWidget::GetLayerManager()
 {
   if (!mLayerManager) {
-    if (mUseAcceleratedRendering) {
+    nsCOMPtr<nsIPrefBranch2> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
+
+    PRBool allowAcceleration = PR_TRUE;
+    if (prefs) {
+      prefs->GetBoolPref("mozilla.widget.accelerated-layers",
+                         &allowAcceleration);
+    }
+
+    if (mUseAcceleratedRendering && allowAcceleration) {
       nsRefPtr<LayerManagerOGL> layerManager =
         new mozilla::layers::LayerManagerOGL(this);
       /**
        * XXX - On several OSes initialization is expected to fail for now.
        * If we'd get a none-basic layer manager they'd crash. This is ok though
        * since on those platforms it will fail. Anyone implementing new
        * platforms on LayerManagerOGL should ensure their widget is able to
        * deal with it though!