diff options
author | vollick@chromium.org <vollick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-17 15:00:46 +0000 |
---|---|---|
committer | vollick@chromium.org <vollick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-17 15:00:46 +0000 |
commit | e3415902ca99fd719078cf1780305f9d68250e76 (patch) | |
tree | 6915d4bd41de88e475f573c220b059bc8059f6df | |
parent | 1be3d61abea26f5342024a10719c3acce2e8f58e (diff) | |
download | chromium_src-e3415902ca99fd719078cf1780305f9d68250e76.zip chromium_src-e3415902ca99fd719078cf1780305f9d68250e76.tar.gz chromium_src-e3415902ca99fd719078cf1780305f9d68250e76.tar.bz2 |
Revert "Revert "Enable composited iframes on hi-DPI.""
This was a speculative revert. It turned out not to be the problem. Relanding.
This reverts commit 9797adb04362cd267e9727c506deebade23446d8.
TBR=zeeshan@chromium.org
BUG=306566
Review URL: https://codereview.chromium.org/27709003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@229126 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/app/generated_resources.grd | 12 | ||||
-rw-r--r-- | chrome/browser/about_flags.cc | 16 | ||||
-rw-r--r-- | content/browser/renderer_host/render_process_host_impl.cc | 4 | ||||
-rw-r--r-- | content/browser/web_contents/web_contents_impl.cc | 16 | ||||
-rw-r--r-- | content/public/common/content_switches.cc | 8 | ||||
-rw-r--r-- | content/public/common/content_switches.h | 2 | ||||
-rw-r--r-- | content/renderer/render_view_impl.cc | 42 |
7 files changed, 96 insertions, 4 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 7aa78be..fa8918f 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -6785,6 +6785,18 @@ Keep your key file in a safe place. You will need it to create new versions of y <message name="IDS_FLAGS_HIDPI_DESCRIPTION" desc="Description of flag to enable/disable HiDPI Support."> If enabled, application size and layout will adapt to the operating system's DPI settings. </message> + <message name="IDS_FLAGS_ENABLE_ACCELERATED_SCROLLABLE_FRAMES_NAME" desc="Name of the flag to enable accelerated scrollable frames."> + Enable accelerated scrollable frames. + </message> + <message name="IDS_FLAGS_ENABLE_ACCELERATED_SCROLLABLE_FRAMES_DESCRIPTION" desc="Description for the flag to enable accelerated scrollable frames."> + Enables accelerated compositing for scrollable frames. + </message> + <message name="IDS_FLAGS_ENABLE_COMPOSITED_SCROLLING_FOR_FRAMES_NAME" desc="Name of the flag to enable composited scrolling for frames."> + Enable composited scrolling for frames. + </message> + <message name="IDS_FLAGS_ENABLE_COMPOSITED_SCROLLING_FOR_FRAMES_DESCRIPTION" desc="Description for the flag to enable composited scrolling for frames."> + Enable accelerated scrolling by the compositer for frames. + </message> <message name="IDS_FLAGS_ENABLE_STREAMLINED_HOSTED_APPS_NAME" desc="Name of the flag to enable streamlined hosted apps."> Enable experimental streamlined hosted apps. </message> diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index ec224ae..66ec1c7 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc @@ -1751,6 +1751,22 @@ const Experiment kExperiments[] = { SINGLE_VALUE_TYPE(cc::switches::kDisableCompositorTouchHitTesting), }, { + "enable-accelerated-scrollable-frames", + IDS_FLAGS_ENABLE_ACCELERATED_SCROLLABLE_FRAMES_NAME, + IDS_FLAGS_ENABLE_ACCELERATED_SCROLLABLE_FRAMES_DESCRIPTION, + kOsAll, + ENABLE_DISABLE_VALUE_TYPE(switches::kEnableAcceleratedScrollableFrames, + switches::kDisableAcceleratedScrollableFrames) + }, + { + "enable-composited-scrolling-for-frames", + IDS_FLAGS_ENABLE_COMPOSITED_SCROLLING_FOR_FRAMES_NAME, + IDS_FLAGS_ENABLE_COMPOSITED_SCROLLING_FOR_FRAMES_DESCRIPTION, + kOsAll, + ENABLE_DISABLE_VALUE_TYPE(switches::kEnableCompositedScrollingForFrames, + switches::kDisableCompositedScrollingForFrames) + }, + { "enable-streamlined-hosted-apps", IDS_FLAGS_ENABLE_STREAMLINED_HOSTED_APPS_NAME, IDS_FLAGS_ENABLE_STREAMLINED_HOSTED_APPS_DESCRIPTION, diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index 177533c..5336df8 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc @@ -872,10 +872,12 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( switches::kDisable3DAPIs, switches::kDisableAcceleratedCompositing, switches::kDisableAcceleratedFixedRootBackground, + switches::kDisableAcceleratedScrollableFrames, switches::kDisableAcceleratedVideoDecode, switches::kDisableApplicationCache, switches::kDisableAudio, switches::kDisableBreakpad, + switches::kDisableCompositedScrollingForFrames, switches::kDisableCompositingForFixedPosition, switches::kDisableCompositingForTransition, switches::kDisableDatabases, @@ -911,9 +913,11 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( switches::kDomAutomationController, switches::kEnableAcceleratedFixedRootBackground, switches::kEnableAcceleratedOverflowScroll, + switches::kEnableAcceleratedScrollableFrames, switches::kEnableAccessibilityLogging, switches::kEnableBeginFrameScheduling, switches::kEnableBrowserPluginForAllViewTypes, + switches::kEnableCompositedScrollingForFrames, switches::kEnableCompositingForFixedPosition, switches::kEnableCompositingForTransition, switches::kEnableDCHECK, diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index 7f68273..64a91f4 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc @@ -521,10 +521,18 @@ WebPreferences WebContentsImpl::GetWebkitPrefs(RenderViewHost* rvh, if (command_line.HasSwitch(switches::kDisableAcceleratedOverflowScroll)) prefs.accelerated_compositing_for_overflow_scroll_enabled = false; - prefs.accelerated_compositing_for_scrollable_frames_enabled = - command_line.HasSwitch(switches::kEnableAcceleratedScrollableFrames); - prefs.composited_scrolling_for_frames_enabled = - command_line.HasSwitch(switches::kEnableCompositedScrollingForFrames); + prefs.accelerated_compositing_for_scrollable_frames_enabled = false; + if (command_line.HasSwitch(switches::kEnableAcceleratedScrollableFrames)) + prefs.accelerated_compositing_for_scrollable_frames_enabled = true; + if (command_line.HasSwitch(switches::kDisableAcceleratedScrollableFrames)) + prefs.accelerated_compositing_for_scrollable_frames_enabled = false; + + prefs.composited_scrolling_for_frames_enabled = false; + if (command_line.HasSwitch(switches::kEnableCompositedScrollingForFrames)) + prefs.composited_scrolling_for_frames_enabled = true; + if (command_line.HasSwitch(switches::kDisableCompositedScrollingForFrames)) + prefs.composited_scrolling_for_frames_enabled = false; + prefs.show_paint_rects = command_line.HasSwitch(switches::kShowPaintRects); prefs.accelerated_compositing_enabled = diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc index 0167733..158c4f9 100644 --- a/content/public/common/content_switches.cc +++ b/content/public/common/content_switches.cc @@ -90,6 +90,10 @@ const char kDisableAcceleratedLayers[] = "disable-accelerated-layers"; const char kDisableAcceleratedOverflowScroll[] = "disable-accelerated-overflow-scroll"; +// Disable accelerated compositing for scrollable frames. +const char kDisableAcceleratedScrollableFrames[] = + "disable-accelerated-scrollable-frames"; + // Disables the hardware acceleration of plugins. const char kDisableAcceleratedPlugins[] = "disable-accelerated-plugins"; @@ -118,6 +122,10 @@ const char kDisableBackingStoreLimit[] = "disable-backing-store-limit"; const char kDisableBrowserPluginCompositing[] = "disable-browser-plugin-compositing"; +// Disable accelerated scrolling by the compositor for frames. +const char kDisableCompositedScrollingForFrames[] = + "disable-composited-scrolling-for-frames"; + // See comment for kEnableCompositingForFixedPosition. const char kDisableCompositingForFixedPosition[] = "disable-fixed-position-compositing"; diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h index c895113..6ecdd25 100644 --- a/content/public/common/content_switches.h +++ b/content/public/common/content_switches.h @@ -38,6 +38,7 @@ CONTENT_EXPORT extern const char kDisableAcceleratedFixedRootBackground[]; CONTENT_EXPORT extern const char kDisableAcceleratedLayers[]; extern const char kDisableAcceleratedOverflowScroll[]; CONTENT_EXPORT extern const char kDisableAcceleratedPlugins[]; +extern const char kDisableAcceleratedScrollableFrames[]; CONTENT_EXPORT extern const char kDisableAcceleratedVideo[]; CONTENT_EXPORT extern const char kDisableAcceleratedVideoDecode[]; CONTENT_EXPORT extern const char kDisableAltWinstation[]; @@ -45,6 +46,7 @@ CONTENT_EXPORT extern const char kDisableApplicationCache[]; CONTENT_EXPORT extern const char kDisableAudio[]; extern const char kDisableBackingStoreLimit[]; CONTENT_EXPORT extern const char kDisableBrowserPluginCompositing[]; +extern const char kDisableCompositedScrollingForFrames[]; CONTENT_EXPORT extern const char kDisableCompositingForFixedPosition[]; CONTENT_EXPORT extern const char kDisableCompositingForTransition[]; CONTENT_EXPORT extern const char kDisableDatabases[]; diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc index aef0ac7..18ac4b3 100644 --- a/content/renderer/render_view_impl.cc +++ b/content/renderer/render_view_impl.cc @@ -31,6 +31,7 @@ #include "base/strings/sys_string_conversions.h" #include "base/strings/utf_string_conversions.h" #include "base/time/time.h" +#include "cc/base/switches.h" #include "content/child/appcache/appcache_dispatcher.h" #include "content/child/appcache/web_application_cache_host_impl.h" #include "content/child/child_thread.h" @@ -606,6 +607,38 @@ static bool ShouldUseAcceleratedCompositingForOverflowScroll( return DeviceScaleEnsuresTextQuality(device_scale_factor); } +static bool ShouldUseAcceleratedCompositingForScrollableFrames( + float device_scale_factor) { + const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + + if (command_line.HasSwitch(switches::kDisableAcceleratedScrollableFrames)) + return false; + + if (command_line.HasSwitch(switches::kEnableAcceleratedScrollableFrames)) + return true; + + if (!cc::switches::IsLCDTextEnabled()) + return true; + + return DeviceScaleEnsuresTextQuality(device_scale_factor); +} + +static bool ShouldUseCompositedScrollingForFrames( + float device_scale_factor) { + const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + + if (command_line.HasSwitch(switches::kDisableCompositedScrollingForFrames)) + return false; + + if (command_line.HasSwitch(switches::kEnableCompositedScrollingForFrames)) + return true; + + if (!cc::switches::IsLCDTextEnabled()) + return true; + + return DeviceScaleEnsuresTextQuality(device_scale_factor); +} + static bool ShouldUseTransitionCompositing(float device_scale_factor) { const CommandLine& command_line = *CommandLine::ForCurrentProcess(); @@ -899,6 +932,10 @@ void RenderViewImpl::Initialize(RenderViewImplParams* params) { ShouldUseTransitionCompositing(device_scale_factor_)); webview()->settings()->setAcceleratedCompositingForFixedRootBackgroundEnabled( ShouldUseAcceleratedFixedRootBackground(device_scale_factor_)); + webview()->settings()->setAcceleratedCompositingForScrollableFramesEnabled( + ShouldUseAcceleratedCompositingForScrollableFrames(device_scale_factor_)); + webview()->settings()->setCompositedScrollingForFramesEnabled( + ShouldUseCompositedScrollingForFrames(device_scale_factor_)); ApplyWebPreferences(webkit_preferences_, webview()); @@ -6006,6 +6043,11 @@ void RenderViewImpl::SetDeviceScaleFactor(float device_scale_factor) { webview()->settings()-> setAcceleratedCompositingForFixedRootBackgroundEnabled( ShouldUseAcceleratedFixedRootBackground(device_scale_factor_)); + webview()->settings()->setAcceleratedCompositingForScrollableFramesEnabled( + ShouldUseAcceleratedCompositingForScrollableFrames( + device_scale_factor_)); + webview()->settings()->setCompositedScrollingForFramesEnabled( + ShouldUseCompositedScrollingForFrames(device_scale_factor_)); } if (auto_resize_mode_) AutoResizeCompositor(); |