Bug 1479757 - Switch to containerless scrolling for GeckoView+WR. r=botond
authorKartikaya Gupta <kgupta@mozilla.com>
Mon, 15 Oct 2018 17:41:21 +0000
changeset 499759 835e3524a6caa63d1b6d1dc84077e900cc56873b
parent 499758 88d826bf6a68a5f9ead87b17f51ec3747b3e86a9
child 499760 7e55a78b333997c6ccf98ee3669dc284648ea3c8
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1479757 - Switch to containerless scrolling for GeckoView+WR. r=botond This changes the containerful scrolling pref to be an override pref such that it is: - always false on desktop (i.e. always use containerless there) - always true in Fennec (i.e. never use containerless there) - true in GeckoView if WebRender is disabled (i.e. only use containerless with WebRender). The first two cases are the same as before; the last case is new. Because we don't create layers with WR, the containerless vs containerful distinction doesn't make much sense there, and we need to implement a bunch of zooming glue in either case. So it makes sense to go with the "way of the future" and keep it containerless. Differential Revision: https://phabricator.services.mozilla.com/D8733
--- a/gfx/layers/apz/test/mochitest/test_group_zoom.html
+++ b/gfx/layers/apz/test/mochitest/test_group_zoom.html
@@ -29,17 +29,17 @@ var prefs = [
   // Explicitly enable pinch-zooming, so this test can run on desktop
   // even though zooming isn't enabled by default on desktop yet.
   ["apz.allow_zooming", true],
   // Pinch-zooming currently requires meta viewport support (this requirement
   // will eventually be removed).
   ["dom.meta-viewport.enabled", true],
   // Pinch-zooming currently requires container scrolling (this requirement
   // will eventually be removed).
-  ["layout.scroll.root-frame-containers", true],
+  ["layout.scroll.root-frame-containers", 1],
   // Retained displaylists don't work well with container scrolling, so
   // they too need to be disabled for now.
   ["layout.display-list.retain", false],
   ["layout.display-list.retain.chrome", false],
 // Increase the tap timeouts so the double-tap is still detected in case of
 // random delays during testing.
--- a/gfx/thebes/gfxPrefs.h
+++ b/gfx/thebes/gfxPrefs.h
@@ -698,17 +698,17 @@ private:
   DECL_GFX_PREF(Live, "layout.display-list.flatten-transform", LayoutFlattenTransform, bool, true);
   DECL_GFX_PREF(Once, "layout.frame_rate",                     LayoutFrameRate, int32_t, -1);
   DECL_GFX_PREF(Once, "layout.less-event-region-items",        LessEventRegionItems, bool, true);
   DECL_GFX_PREF(Live, "layout.min-active-layer-size",          LayoutMinActiveLayerSize, int, 64);
   DECL_GFX_PREF(Once, "layout.paint_rects_separately",         LayoutPaintRectsSeparately, bool, true);
   // This and code dependent on it should be removed once containerless scrolling looks stable.
-  DECL_GFX_PREF(Live, "layout.scroll.root-frame-containers",   LayoutUseContainersForRootFrames, bool, true);
+  DECL_OVERRIDE_PREF(Live, "layout.scroll.root-frame-containers",   LayoutUseContainersForRootFrames, !OverrideBase_WebRender());
   // This pref is to be set by test code only.
   DECL_GFX_PREF(Live, "layout.scrollbars.always-layerize-track", AlwaysLayerizeScrollbarTrackTestOnly, bool, false);
   DECL_GFX_PREF(Live, "layout.smaller-painted-layers",         LayoutSmallerPaintedLayers, bool, false);
   DECL_GFX_PREF(Once, "media.hardware-video-decoding.force-enabled",
                                                                HardwareVideoDecodingForceEnabled, bool, false);
 #ifdef XP_WIN
   DECL_GFX_PREF(Live, "media.wmf.dxva.d3d11.enabled", PDMWMFAllowD3D11, bool, true);
--- a/mobile/android/app/geckoview-prefs.js
+++ b/mobile/android/app/geckoview-prefs.js
@@ -22,8 +22,13 @@ pref("geckoview.console.enabled", false)
 pref("geckoview.logging", "Warn");
 pref("geckoview.logging", "Debug");
 // Disable Web Push until we get it working
 pref("dom.push.enabled", false);
+// Unlike Fennec, GeckoView may have WebRender enabled, and with WebRender we're
+// going with containerless scrolling (because there are no layers at all with
+// WR, so why not go containerless). So we set this pref to pick up the value
+// in gfxPrefs.h from whether or not WR is enabled.
+pref("layout.scroll.root-frame-containers", 2);
--- a/mobile/android/app/mobile.js
+++ b/mobile/android/app/mobile.js
@@ -539,16 +539,20 @@ pref("layers.low-precision-resolution", 
 pref("layers.low-precision-opacity", "1.0");
 // We want to limit layers for two reasons:
 // 1) We can't scroll smoothly if we have to many draw calls
 // 2) Pages that have too many layers consume too much memory and crash.
 // By limiting the number of layers on mobile we're making the main thread
 // work harder keep scrolling smooth and memory low.
 pref("layers.max-active", 20);
+// On Fennec we need containerful scrolling to support zooming. Bug 1459312
+// tracks zooming with containerless scrolling.
+pref("layout.scroll.root-frame-containers", 1);
 pref("notification.feature.enabled", true);
 pref("dom.webnotifications.enabled", true);
 // prevent tooltips from showing up
 pref("browser.chrome.toolbar_tips", false);
 // don't allow meta-refresh when backgrounded
 pref("browser.meta_refresh_when_inactive.disabled", true);
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -772,20 +772,18 @@ pref("apz.y_stationary_size_multiplier",
 #ifdef XP_MACOSX
 // Whether to run in native HiDPI mode on machines with "Retina"/HiDPI display;
 //   <= 0 : hidpi mode disabled, display will just use pixel-based upscaling
 //   == 1 : hidpi supported if all screens share the same backingScaleFactor
 //   >= 2 : hidpi supported even with mixed backingScaleFactors (somewhat broken)
 pref("gfx.hidpi.enabled", 2);
-#if !defined(MOZ_WIDGET_ANDROID)
-// Use containerless scrolling for now on desktop.
-pref("layout.scroll.root-frame-containers", false);
+// Default to containerless scrolling
+pref("layout.scroll.root-frame-containers", 0);
 pref("layout.scrollbars.always-layerize-track", false);
 // Whether to enable LayerScope tool and default listening port
 pref("gfx.layerscope.enabled", false);
 pref("gfx.layerscope.port", 23456);
 // Log severe performance warnings to the error console and profiles.