Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(203)

Unified Diff: content/renderer/render_view_impl.cc

Issue 12544030: Chromium side plumbing for enabling fixed root background compositing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/common/content_switches.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 6851b4e6200d69d6548b252321ba3842e8e9f4b6..542375d841919910da523e62e4ab62e4bc5e71b0 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -605,6 +605,18 @@ static bool ShouldUseTransitionCompositing(float device_scale_factor) {
return DeviceScaleEnsuresTextQuality(device_scale_factor);
}
+static bool ShouldUseAcceleratedFixedRootBackground(float device_scale_factor) {
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+
+ if (command_line.HasSwitch(switches::kDisableAcceleratedFixedRootBackground))
+ return false;
+
+ if (command_line.HasSwitch(switches::kEnableAcceleratedFixedRootBackground))
+ return true;
+
+ return DeviceScaleEnsuresTextQuality(device_scale_factor);
+}
+
static FaviconURL::IconType ToFaviconType(WebKit::WebIconURL::Type type) {
switch (type) {
case WebKit::WebIconURL::TypeFavicon:
@@ -878,6 +890,8 @@ void RenderViewImpl::Initialize(RenderViewImplParams* params) {
ShouldUseFixedPositionCompositing(device_scale_factor_));
webview()->settings()->setAcceleratedCompositingForTransitionEnabled(
ShouldUseTransitionCompositing(device_scale_factor_));
+ webview()->settings()->setAcceleratedCompositingForFixedRootBackgroundEnabled(
+ ShouldUseAcceleratedFixedRootBackground(device_scale_factor_));
webkit_glue::ApplyWebPreferences(webkit_preferences_, webview());
webview()->initializeMainFrame(this);
@@ -6197,6 +6211,9 @@ void RenderViewImpl::SetDeviceScaleFactor(float device_scale_factor) {
ShouldUseFixedPositionCompositing(device_scale_factor_));
webview()->settings()->setAcceleratedCompositingForTransitionEnabled(
ShouldUseTransitionCompositing(device_scale_factor_));
+ webview()->settings()->
+ setAcceleratedCompositingForFixedRootBackgroundEnabled(
+ ShouldUseAcceleratedFixedRootBackground(device_scale_factor_));
}
if (auto_resize_mode_)
AutoResizeCompositor();
« no previous file with comments | « content/public/common/content_switches.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698