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

Unified Diff: content/renderer/render_view_impl.cc

Issue 485663002: Revert of Remove the acclerated overflow scroll and fixed root background flags. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 7b9ea0bba89272587081549b1a60ae56a64d09bc..63b77c78387e0efe10893485302d181586a5ccf5 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -408,6 +408,19 @@
return DeviceScaleEnsuresTextQuality(device_scale_factor);
}
+static bool ShouldUseAcceleratedCompositingForOverflowScroll(
+ float device_scale_factor) {
+ const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+
+ if (command_line.HasSwitch(switches::kDisableAcceleratedOverflowScroll))
+ return false;
+
+ if (command_line.HasSwitch(switches::kEnableAcceleratedOverflowScroll))
+ return true;
+
+ return DeviceScaleEnsuresTextQuality(device_scale_factor);
+}
+
static bool ShouldUseCompositedScrollingForFrames(
float device_scale_factor) {
if (RenderThreadImpl::current() &&
@@ -430,6 +443,18 @@
// of excessive layer promotion caused by overlap has been addressed.
// http://crbug.com/178119.
return false;
+}
+
+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(blink::WebIconURL::Type type) {
@@ -769,11 +794,11 @@
webview()->settings()->setPreferCompositingToLCDTextEnabled(
PreferCompositingToLCDText(device_scale_factor_));
webview()->settings()->setAcceleratedCompositingForOverflowScrollEnabled(
- PreferCompositingToLCDText(device_scale_factor_));
+ ShouldUseAcceleratedCompositingForOverflowScroll(device_scale_factor_));
webview()->settings()->setAcceleratedCompositingForTransitionEnabled(
ShouldUseTransitionCompositing(device_scale_factor_));
webview()->settings()->setAcceleratedCompositingForFixedRootBackgroundEnabled(
- PreferCompositingToLCDText(device_scale_factor_));
+ ShouldUseAcceleratedFixedRootBackground(device_scale_factor_));
webview()->settings()->setCompositedScrollingForFramesEnabled(
ShouldUseCompositedScrollingForFrames(device_scale_factor_));
@@ -3741,13 +3766,12 @@
webview()->settings()->setPreferCompositingToLCDTextEnabled(
PreferCompositingToLCDText(device_scale_factor_));
webview()->settings()->setAcceleratedCompositingForOverflowScrollEnabled(
- PreferCompositingToLCDText(device_scale_factor_));
+ ShouldUseAcceleratedCompositingForOverflowScroll(device_scale_factor_));
webview()->settings()->setAcceleratedCompositingForTransitionEnabled(
ShouldUseTransitionCompositing(device_scale_factor_));
- webview()
- ->settings()
- ->setAcceleratedCompositingForFixedRootBackgroundEnabled(
- PreferCompositingToLCDText(device_scale_factor_));
+ webview()->settings()->
+ setAcceleratedCompositingForFixedRootBackgroundEnabled(
+ ShouldUseAcceleratedFixedRootBackground(device_scale_factor_));
webview()->settings()->setCompositedScrollingForFramesEnabled(
ShouldUseCompositedScrollingForFrames(device_scale_factor_));
}
« 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