Bug 623446. Fix force-enabling layer acceleration on non-Windows. r=joe,a=b

--HG--
extra : rebase_source : 0ee05e18c71dcb83437b9b27133c73ec290d22cd
This commit is contained in:
Jeff Muizelaar 2011-01-11 17:58:10 -05:00
parent dd52241c9a
commit 3907cceab1

View File

@ -783,6 +783,7 @@ nsBaseWidget::GetShouldAccelerate()
nsCOMPtr<nsIPrefBranch2> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
PRBool disableAcceleration = PR_FALSE;
PRBool forceAcceleration = PR_FALSE;
#if defined(XP_WIN) || defined(XP_MACOSX)
PRBool accelerateByDefault = PR_TRUE;
#else
@ -793,6 +794,10 @@ nsBaseWidget::GetShouldAccelerate()
// we should use AddBoolPrefVarCache
prefs->GetBoolPref("layers.acceleration.disabled",
&disableAcceleration);
prefs->GetBoolPref("layers.acceleration.force-enabled",
&forceAcceleration);
}
const char *acceleratedEnv = PR_GetEnv("MOZ_ACCELERATED");
@ -807,7 +812,7 @@ nsBaseWidget::GetShouldAccelerate()
if (disableAcceleration || safeMode)
return PR_FALSE;
if (accelerateByDefault)
if (accelerateByDefault || forceAcceleration)
return PR_TRUE;
/* use the window acceleration flag */