Bug 565387: Add a pref to disable accelerated layers by force. r=vlad

This commit is contained in:
Bas Schouten 2010-05-12 20:56:31 +02:00
parent 9dc97fd45f
commit f1f06de017
2 changed files with 12 additions and 1 deletions

View File

@ -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);

View File

@ -661,7 +661,15 @@ nsBaseWidget::AutoLayerManagerSetup::~AutoLayerManagerSetup()
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);
/**