From f1f06de017938b4258ff46758c672b33f72bbd69 Mon Sep 17 00:00:00 2001 From: Bas Schouten Date: Wed, 12 May 2010 20:56:31 +0200 Subject: [PATCH] Bug 565387: Add a pref to disable accelerated layers by force. r=vlad --- modules/libpref/src/init/all.js | 3 +++ widget/src/xpwidgets/nsBaseWidget.cpp | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/modules/libpref/src/init/all.js b/modules/libpref/src/init/all.js index de1ad75a92c..451fa571540 100644 --- a/modules/libpref/src/init/all.js +++ b/modules/libpref/src/init/all.js @@ -2808,6 +2808,9 @@ pref("gfx.color_management.mode", 0); // 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); diff --git a/widget/src/xpwidgets/nsBaseWidget.cpp b/widget/src/xpwidgets/nsBaseWidget.cpp index 01998397f34..17c05316f38 100644 --- a/widget/src/xpwidgets/nsBaseWidget.cpp +++ b/widget/src/xpwidgets/nsBaseWidget.cpp @@ -661,7 +661,15 @@ nsBaseWidget::AutoLayerManagerSetup::~AutoLayerManagerSetup() LayerManager* nsBaseWidget::GetLayerManager() { if (!mLayerManager) { - if (mUseAcceleratedRendering) { + nsCOMPtr prefs = do_GetService(NS_PREFSERVICE_CONTRACTID); + + PRBool allowAcceleration = PR_TRUE; + if (prefs) { + prefs->GetBoolPref("mozilla.widget.accelerated-layers", + &allowAcceleration); + } + + if (mUseAcceleratedRendering && allowAcceleration) { nsRefPtr layerManager = new mozilla::layers::LayerManagerOGL(this); /**