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

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: Forgot to add the changes to cc_messages.h 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..550adfd09360ca50378f77ffef2a97e2e1f1ff89 100644
--- a/cc/layer_tree_settings.cc
+++ b/cc/layer_tree_settings.cc
@@ -26,6 +26,7 @@ LayerTreeSettings::LayerTreeSettings()
, showOverdrawInTracing(false)
, canUseLCDText(true)
, shouldClearRootRenderPass(true)
+ , calculateTopControlsPosition(false)
, refreshRate(0)
, maxPartialTextureUpdates(std::numeric_limits<size_t>::max())
, numRasterThreads(1)
@@ -40,6 +41,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