Index: cc/layer_tree_settings.cc |
diff --git a/cc/layer_tree_settings.cc b/cc/layer_tree_settings.cc |
index f8b964307a539c30527ac2d1701c903def2912a8..20ccd6917ea3a688e00ef0e4d3de24595cc2cfb7 100644 |
--- a/cc/layer_tree_settings.cc |
+++ b/cc/layer_tree_settings.cc |
@@ -27,9 +27,11 @@ LayerTreeSettings::LayerTreeSettings() |
, canUseLCDText(true) |
, shouldClearRootRenderPass(true) |
, useLinearFadeScrollbarAnimator(false) |
+ , calculateTopControlsPosition(false) |
, refreshRate(0) |
, maxPartialTextureUpdates(std::numeric_limits<size_t>::max()) |
, numRasterThreads(1) |
+ , topControlsHeightPx(0) |
, defaultTileSize(gfx::Size(256, 256)) |
, maxUntiledLayerSize(gfx::Size(512, 512)) |
, minimumOcclusionTrackingSize(gfx::Size(160, 160)) |
@@ -41,6 +43,19 @@ LayerTreeSettings::LayerTreeSettings() |
backgroundColorInsteadOfCheckerboard = CommandLine::ForCurrentProcess()->HasSwitch(switches::kBackgroundColorInsteadOfCheckerboard); |
showOverdrawInTracing = CommandLine::ForCurrentProcess()->HasSwitch(switches::kTraceOverdraw); |
+ calculateTopControlsPosition = CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableTopControlsPositionCalculation); |
jamesr
2013/01/08 02:26:48
I don't understand how this could work for both th
Ted C
2013/01/08 18:17:33
Hmm...so move this check to web_layer_tree_view_im
Ted C
2013/01/09 23:36:01
I just uploaded a patch where I moved it to web_la
|
+ 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) |
+ topControlsHeightPx = controls_height; |
+ } |
+ if (calculateTopControlsPosition && (topControlsHeightPx <= 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) |