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

Unified Diff: cc/layer_tree_settings.cc

Issue 11552009: Add support for calculating the position of the top controls in the cc layer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove some unnecessary bits after addressing comments. Created 8 years 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
Index: cc/layer_tree_settings.cc
diff --git a/cc/layer_tree_settings.cc b/cc/layer_tree_settings.cc
index 4221167c29fa139a0ed67d473ea6deccda6bc79e..8eba4f606097c452e2dba547b4ff2d0bc7008cf9 100644
--- a/cc/layer_tree_settings.cc
+++ b/cc/layer_tree_settings.cc
@@ -26,9 +26,11 @@ LayerTreeSettings::LayerTreeSettings()
, showOverdrawInTracing(false)
, canUseLCDText(true)
, shouldClearRootRenderPass(true)
+ , calculateTopControlsPosition(false)
, refreshRate(0)
, maxPartialTextureUpdates(std::numeric_limits<size_t>::max())
, numRasterThreads(1)
+ , topControlsHeight(0)
, defaultTileSize(gfx::Size(256, 256))
, maxUntiledLayerSize(gfx::Size(512, 512))
, minimumOcclusionTrackingSize(gfx::Size(160, 160))
@@ -40,6 +42,19 @@ LayerTreeSettings::LayerTreeSettings()
backgroundColorInsteadOfCheckerboard = CommandLine::ForCurrentProcess()->HasSwitch(switches::kBackgroundColorInsteadOfCheckerboard);
showOverdrawInTracing = CommandLine::ForCurrentProcess()->HasSwitch(switches::kTraceOverdraw);
+ calculateTopControlsPosition = CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableTopControlsPositionCalculation);
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kTopControlsHeight)) {
+ std::string controls_height_str =
+ CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kTopControlsHeight);
+ int controls_height;
+ if (base::StringToInt(controls_height_str, &controls_height) && controls_height > 0)
+ topControlsHeight = controls_height;
+ }
+ if (calculateTopControlsPosition && (topControlsHeight <= 0 || !compositorFrameMessage)) {
+ DCHECK(false) << "Top controls repositioning enabled without valid height or compositorFrameMessage set.";
+ calculateTopControlsPosition = false;
+ }
+
// TODO(alokp): Remove this hard-coded setting.
// Platforms that need to disable LCD text must explicitly set this value.
#if defined(OS_ANDROID)

Powered by Google App Engine
This is Rietveld 408576698