Bug 1105109 - Put APZ autoscrolling behind a pref. r=kats

For now, the pref is off by default.

MozReview-Commit-ID: BtzmFGIAGey

--HG--
extra : rebase_source : a85b20059ae904cc18241e128974bbe8ee060468
This commit is contained in:
Botond Ballo 2017-07-28 19:01:52 -04:00
Родитель e0c06e98b6
Коммит 3916c49dc6
4 изменённых файлов: 9 добавлений и 2 удалений

Просмотреть файл

@ -135,6 +135,10 @@ typedef GenericFlingAnimation FlingAnimation;
* a single input block. If set to false, a single input block can only * a single input block. If set to false, a single input block can only
* scroll one APZC. * scroll one APZC.
* *
* \li\b apz.autoscroll.enabled
* If set to true, autoscrolling is driven by APZ rather than the content
* process main thread.
*
* \li\b apz.axis_lock.mode * \li\b apz.axis_lock.mode
* The preferred axis locking style. See AxisLockMode for possible values. * The preferred axis locking style. See AxisLockMode for possible values.
* *

Просмотреть файл

@ -285,6 +285,7 @@ private:
DECL_GFX_PREF(Live, "apz.allow_checkerboarding", APZAllowCheckerboarding, bool, true); DECL_GFX_PREF(Live, "apz.allow_checkerboarding", APZAllowCheckerboarding, bool, true);
DECL_GFX_PREF(Live, "apz.allow_immediate_handoff", APZAllowImmediateHandoff, bool, true); DECL_GFX_PREF(Live, "apz.allow_immediate_handoff", APZAllowImmediateHandoff, bool, true);
DECL_GFX_PREF(Live, "apz.allow_zooming", APZAllowZooming, bool, false); DECL_GFX_PREF(Live, "apz.allow_zooming", APZAllowZooming, bool, false);
DECL_GFX_PREF(Live, "apz.autoscroll.enabled", APZAutoscrollEnabled, bool, false);
DECL_GFX_PREF(Live, "apz.axis_lock.breakout_angle", APZAxisBreakoutAngle, float, float(M_PI / 8.0) /* 22.5 degrees */); DECL_GFX_PREF(Live, "apz.axis_lock.breakout_angle", APZAxisBreakoutAngle, float, float(M_PI / 8.0) /* 22.5 degrees */);
DECL_GFX_PREF(Live, "apz.axis_lock.breakout_threshold", APZAxisBreakoutThreshold, float, 1.0f / 32.0f); DECL_GFX_PREF(Live, "apz.axis_lock.breakout_threshold", APZAxisBreakoutThreshold, float, 1.0f / 32.0f);
DECL_GFX_PREF(Live, "apz.axis_lock.direct_pan_angle", APZAllowedDirectPanAngle, float, float(M_PI / 3.0) /* 60 degrees */); DECL_GFX_PREF(Live, "apz.axis_lock.direct_pan_angle", APZAllowedDirectPanAngle, float, float(M_PI / 3.0) /* 60 degrees */);

Просмотреть файл

@ -678,6 +678,7 @@ pref("layers.geometry.d3d11.enabled", true);
pref("apz.allow_checkerboarding", true); pref("apz.allow_checkerboarding", true);
pref("apz.allow_immediate_handoff", true); pref("apz.allow_immediate_handoff", true);
pref("apz.allow_zooming", false); pref("apz.allow_zooming", false);
pref("apz.autoscroll.enabled", false);
// Whether to lock touch scrolling to one axis at a time // Whether to lock touch scrolling to one axis at a time
// 0 = FREE (No locking at all) // 0 = FREE (No locking at all)

Просмотреть файл

@ -1091,7 +1091,8 @@
return false; return false;
} }
this.startScroll(data.scrolldir, data.screenX, data.screenY); this.startScroll(data.scrolldir, data.screenX, data.screenY);
if (this.isRemoteBrowser && data.scrollId != null) { if (this.isRemoteBrowser && data.scrollId != null &&
this.mPrefs.getBoolPref("apz.autoscroll.enabled", false)) {
let { tabParent } = this.frameLoader; let { tabParent } = this.frameLoader;
if (tabParent) { if (tabParent) {
tabParent.startApzAutoscroll(data.screenX, data.screenY, tabParent.startApzAutoscroll(data.screenX, data.screenY,
@ -1219,7 +1220,7 @@
window.removeEventListener("keyup", this, true); window.removeEventListener("keyup", this, true);
this.messageManager.sendAsyncMessage("Autoscroll:Stop"); this.messageManager.sendAsyncMessage("Autoscroll:Stop");
if (this.isRemoteBrowser) { if (this.isRemoteBrowser && this._autoScrollScrollId != null) {
let { tabParent } = this.frameLoader; let { tabParent } = this.frameLoader;
if (tabParent) { if (tabParent) {
tabParent.stopApzAutoscroll(this._autoScrollScrollId, tabParent.stopApzAutoscroll(this._autoScrollScrollId,