Bug 944938 - Move the layers.async-pan-zoom.enabled pref to gfxPrefs and make it override the apz subframe pref when false. r=kats

This commit is contained in:
Markus Stange 2014-06-03 15:39:44 +02:00
parent 77db589b6c
commit 7e5c225100
4 changed files with 11 additions and 12 deletions

View File

@ -61,6 +61,7 @@
#include "TabChild.h"
#include "LoadContext.h"
#include "nsNetCID.h"
#include "gfxPrefs.h"
#include <algorithm>
using namespace mozilla::dom;
@ -1888,9 +1889,7 @@ bool
TabParent::UseAsyncPanZoom()
{
bool usingOffMainThreadCompositing = !!CompositorParent::CompositorLoop();
bool asyncPanZoomEnabled =
Preferences::GetBool("layers.async-pan-zoom.enabled", false);
return (usingOffMainThreadCompositing && asyncPanZoomEnabled &&
return (usingOffMainThreadCompositing && gfxPrefs::AsyncPanZoomEnabled() &&
GetScrollingBehavior() == ASYNC_PAN_ZOOM);
}

View File

@ -169,6 +169,7 @@ private:
DECL_GFX_PREF(Once, "layers.acceleration.force-enabled", LayersAccelerationForceEnabled, bool, false);
DECL_GFX_PREF(Once, "layers.async-video.enabled", AsyncVideoEnabled, bool, false);
DECL_GFX_PREF(Once, "layers.async-video-oop.enabled", AsyncVideoOOPEnabled, bool, false);
DECL_GFX_PREF(Once, "layers.async-pan-zoom.enabled", AsyncPanZoomEnabled, bool, false);
DECL_GFX_PREF(Live, "layers.bench.enabled", LayersBenchEnabled, bool, false);
DECL_GFX_PREF(Once, "layers.bufferrotation.enabled", BufferRotationEnabled, bool, true);
#ifdef MOZ_GFX_OPTIMIZE_MOBILE

View File

@ -6655,14 +6655,15 @@ nsLayoutUtils::CalculateExpandedScrollableRect(nsIFrame* aFrame)
/* static */ bool
nsLayoutUtils::WantSubAPZC()
{
// TODO Turn this on for inprocess OMTC on all platforms
bool wantSubAPZC = gfxPrefs::APZSubframeEnabled();
// TODO Turn this on for inprocess OMTC on all platforms
bool wantSubAPZC = gfxPrefs::AsyncPanZoomEnabled() &&
gfxPrefs::APZSubframeEnabled();
#ifdef MOZ_WIDGET_GONK
if (XRE_GetProcessType() != GeckoProcessType_Content) {
wantSubAPZC = false;
}
if (XRE_GetProcessType() != GeckoProcessType_Content) {
wantSubAPZC = false;
}
#endif
return wantSubAPZC;
return wantSubAPZC;
}
/* static */ void

View File

@ -1020,9 +1020,7 @@ MetroWidget::ShouldUseBasicManager()
bool
MetroWidget::ShouldUseAPZC()
{
const char* kPrefName = "layers.async-pan-zoom.enabled";
return ShouldUseOffMainThreadCompositing() &&
Preferences::GetBool(kPrefName, false);
return gfxPrefs::AsyncPanZoomEnabled();
}
void