Bug 915385 - Add a hidden pref for disabling apz zoom. r=kats

This commit is contained in:
Jim Mathies 2013-09-12 12:30:05 -05:00
parent a4d2b978d6
commit 330ed0145e

View File

@ -142,12 +142,18 @@ static float gYStationarySizeMultiplier = 2.5f;
*/
static int gAsyncScrollThrottleTime = 100;
/**
* The timeout in ms for mAsyncScrollTimeoutTask delay task.
* Default is 300ms if there is no "apzc.asyncscroll.timeout" in preference.
*/
static int gAsyncScrollTimeout = 300;
/**
* Temporary pref for disabling zoom in metrofx on aurora.
*/
static bool gAsyncZoomDisabled = false;
static TimeStamp sFrameTime;
static TimeStamp
@ -185,6 +191,7 @@ AsyncPanZoomController::InitializeGlobalState()
Preferences::AddFloatVarCache(&gYStationarySizeMultiplier, "gfx.azpc.y_stationary_size_multiplier", gYStationarySizeMultiplier);
Preferences::AddIntVarCache(&gAsyncScrollThrottleTime, "apzc.asyncscroll.throttle", gAsyncScrollThrottleTime);
Preferences::AddIntVarCache(&gAsyncScrollTimeout, "apzc.asyncscroll.timeout", gAsyncScrollTimeout);
Preferences::AddBoolVarCache(&gAsyncZoomDisabled, "apzc.asynczoom.disabled", gAsyncZoomDisabled);
gComputedTimingFunction = new ComputedTimingFunction();
gComputedTimingFunction->Init(
@ -221,6 +228,9 @@ AsyncPanZoomController::AsyncPanZoomController(uint64_t aLayersId,
if (aGestures == USE_GESTURE_DETECTOR) {
mGestureEventListener = new GestureEventListener(this);
}
if (gAsyncZoomDisabled) {
mAllowZoom = false;
}
}
AsyncPanZoomController::~AsyncPanZoomController() {
@ -1363,6 +1373,9 @@ void AsyncPanZoomController::SetZoomAndResolution(const CSSToScreenScale& aZoom)
void AsyncPanZoomController::UpdateZoomConstraints(bool aAllowZoom,
const CSSToScreenScale& aMinZoom,
const CSSToScreenScale& aMaxZoom) {
if (gAsyncZoomDisabled) {
return;
}
mAllowZoom = aAllowZoom;
mMinZoom = (MIN_ZOOM > aMinZoom ? MIN_ZOOM : aMinZoom);
mMaxZoom = (MAX_ZOOM > aMaxZoom ? aMaxZoom : MAX_ZOOM);