gfx: add pref for enabling APZ without e10s

This commit is contained in:
Leorize 2018-09-24 08:26:53 +07:00 • committed by Roy Tam
commit f67b2f0342
3 changed files with 10 additions and 5 deletions

View file

@ -2380,13 +2380,13 @@ gfxPlatform::AsyncPanZoomEnabled()
{ {
#if !defined(MOZ_WIDGET_ANDROID) && !defined(MOZ_WIDGET_UIKIT) #if !defined(MOZ_WIDGET_ANDROID) && !defined(MOZ_WIDGET_UIKIT)
// For XUL applications (everything but Firefox on Android) we only want // For XUL applications (everything but Firefox on Android) we only want
// to use APZ when E10S is enabled. If we ever get input events off the // to use APZ when E10S is enabled or when the user explicitly enable it.
// main thread we can consider relaxing this requirement. if (BrowserTabsRemoteAutostart() || gfxPrefs::APZDesktopEnabled()) {
if (!BrowserTabsRemoteAutostart()) { return gfxPrefs::AsyncPanZoomEnabledDoNotUseDirectly();
} else {
return false; return false;
} }
#endif #elif defined(MOZ_WIDGET_ANDROID)
#ifdef MOZ_WIDGET_ANDROID
return true; return true;
#else #else
return gfxPrefs::AsyncPanZoomEnabledDoNotUseDirectly(); return gfxPrefs::AsyncPanZoomEnabledDoNotUseDirectly();

View file

@ -310,6 +310,7 @@ private:
DECL_GFX_PREF(Live, "apz.y_stationary_size_multiplier", APZYStationarySizeMultiplier, float, 3.5f); DECL_GFX_PREF(Live, "apz.y_stationary_size_multiplier", APZYStationarySizeMultiplier, float, 3.5f);
DECL_GFX_PREF(Live, "apz.zoom_animation_duration_ms", APZZoomAnimationDuration, int32_t, 250); DECL_GFX_PREF(Live, "apz.zoom_animation_duration_ms", APZZoomAnimationDuration, int32_t, 250);
DECL_GFX_PREF(Live, "apz.scale_repaint_delay_ms", APZScaleRepaintDelay, int32_t, 500); DECL_GFX_PREF(Live, "apz.scale_repaint_delay_ms", APZScaleRepaintDelay, int32_t, 500);
DECL_GFX_PREF(Once, "apz.desktop.enabled", APZDesktopEnabled, bool, false);
DECL_GFX_PREF(Live, "browser.ui.zoom.force-user-scalable", ForceUserScalable, bool, false); DECL_GFX_PREF(Live, "browser.ui.zoom.force-user-scalable", ForceUserScalable, bool, false);
DECL_GFX_PREF(Live, "browser.viewport.desktopWidth", DesktopViewportWidth, int32_t, 980); DECL_GFX_PREF(Live, "browser.viewport.desktopWidth", DesktopViewportWidth, int32_t, 980);

View file

@ -705,6 +705,10 @@ pref("apz.y_skate_size_multiplier", "1.5");
pref("apz.y_stationary_size_multiplier", "1.5"); pref("apz.y_stationary_size_multiplier", "1.5");
#endif #endif
#if !defined(MOZ_WIDGET_ANDROID) && !defined(MOZ_WIDGET_UIKIT)
pref("apz.desktop.enabled", false);
#endif
#ifdef XP_MACOSX #ifdef XP_MACOSX
// Whether to run in native HiDPI mode on machines with "Retina"/HiDPI display; // Whether to run in native HiDPI mode on machines with "Retina"/HiDPI display;
// <= 0 : hidpi mode disabled, display will just use pixel-based upscaling // <= 0 : hidpi mode disabled, display will just use pixel-based upscaling