Bug 885573 - Stop forcing layers acceleration when we have OMTC enabled. r=nrc

This commit is contained in:
Matt Woodrow 2013-06-24 17:27:29 +12:00
parent 6cc4b5354b
commit e1a0d2923b
4 changed files with 7 additions and 11 deletions

View File

@ -1825,8 +1825,7 @@ void InitLayersAccelerationPrefs()
sPrefLayersOffMainThreadCompositionEnabled = Preferences::GetBool("layers.offmainthreadcomposition.enabled", false);
sPrefLayersOffMainThreadCompositionTestingEnabled = Preferences::GetBool("layers.offmainthreadcomposition.testing.enabled", false);
sPrefLayersOffMainThreadCompositionForceEnabled = Preferences::GetBool("layers.offmainthreadcomposition.force-enabled", false);
sPrefLayersAccelerationForceEnabled = Preferences::GetBool("layers.acceleration.force-enabled", false) ||
Preferences::GetBool("browser.tabs.remote", false);
sPrefLayersAccelerationForceEnabled = Preferences::GetBool("layers.acceleration.force-enabled", false);
sPrefLayersAccelerationDisabled = Preferences::GetBool("layers.acceleration.disabled", false);
sPrefLayersPreferOpenGL = Preferences::GetBool("layers.prefer-opengl", false);
sPrefLayersPreferD3D9 = Preferences::GetBool("layers.prefer-d3d9", false);

View File

@ -448,7 +448,7 @@ public:
NS_IMETHOD DispatchEvent(nsGUIEvent* event, nsEventStatus & aStatus);
virtual bool ComputeShouldAccelerate(bool aDefault);
virtual bool ShouldUseOffMainThreadCompositing();
virtual bool ShouldUseOffMainThreadCompositing() MOZ_OVERRIDE;
NS_IMETHOD SetCursor(nsCursor aCursor);
NS_IMETHOD SetCursor(imgIContainer* aCursor, uint32_t aHotspotX, uint32_t aHotspotY);

View File

@ -1421,7 +1421,8 @@ nsChildView::ShouldUseOffMainThreadCompositing()
// OMTC doesn't work with Basic Layers on OS X right now. Once it works, we'll
// still want to disable it for certain kinds of windows (e.g. popups).
return nsBaseWidget::ShouldUseOffMainThreadCompositing() &&
ComputeShouldAccelerate(mUseLayersAcceleration);
(ComputeShouldAccelerate(mUseLayersAcceleration) ||
Preferences::GetBool("layers.offmainthreadcomposition.prefer-basic", false));
}
inline uint16_t COLOR8TOCOLOR16(uint8_t color8)

View File

@ -910,15 +910,11 @@ void nsBaseWidget::CreateCompositor()
mozilla::layers::LayersBackend
nsBaseWidget::GetPreferredCompositorBackend()
{
// We need a separate preference here (instead of using mUseLayersAcceleration)
// because we force enable accelerated layers with e10s. Once the BasicCompositor
// is stable enough to be used for Ripc/Cipc, then we can remove that and this
// pref.
if (Preferences::GetBool("layers.offmainthreadcomposition.prefer-basic", false)) {
return mozilla::layers::LAYERS_BASIC;
if (mUseLayersAcceleration) {
return mozilla::layers::LAYERS_OPENGL;
}
return mozilla::layers::LAYERS_OPENGL;
return mozilla::layers::LAYERS_BASIC;
}
void nsBaseWidget::CreateCompositor(int aWidth, int aHeight)