OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/gpu/render_widget_compositor.h" | 5 #include "content/renderer/gpu/render_widget_compositor.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 settings.compositorFrameMessage = | 114 settings.compositorFrameMessage = |
115 cmd->HasSwitch(cc::switches::kEnableCompositorFrameMessage); | 115 cmd->HasSwitch(cc::switches::kEnableCompositorFrameMessage); |
116 | 116 |
117 if (settings.calculateTopControlsPosition && | 117 if (settings.calculateTopControlsPosition && |
118 (settings.topControlsHeight <= 0 || !settings.compositorFrameMessage)) { | 118 (settings.topControlsHeight <= 0 || !settings.compositorFrameMessage)) { |
119 DCHECK(false) << "Top controls repositioning enabled without valid height " | 119 DCHECK(false) << "Top controls repositioning enabled without valid height " |
120 "or compositorFrameMessage set."; | 120 "or compositorFrameMessage set."; |
121 settings.calculateTopControlsPosition = false; | 121 settings.calculateTopControlsPosition = false; |
122 } | 122 } |
123 | 123 |
| 124 if (cmd->HasSwitch(cc::switches::kTopControlsShowThreshold)) { |
| 125 std::string top_threshold_str = |
| 126 cmd->GetSwitchValueASCII(cc::switches::kTopControlsShowThreshold); |
| 127 double show_threshold; |
| 128 if (base::StringToDouble(top_threshold_str, &show_threshold) && |
| 129 show_threshold >= 0.f && show_threshold <= 1.f) |
| 130 settings.topControlsShowThreshold = show_threshold; |
| 131 } |
| 132 |
| 133 if (cmd->HasSwitch(cc::switches::kTopControlsHideThreshold)) { |
| 134 std::string top_threshold_str = |
| 135 cmd->GetSwitchValueASCII(cc::switches::kTopControlsHideThreshold); |
| 136 double hide_threshold; |
| 137 if (base::StringToDouble(top_threshold_str, &hide_threshold) && |
| 138 hide_threshold >= 0.f && hide_threshold <= 1.f) |
| 139 settings.topControlsHideThreshold = hide_threshold; |
| 140 } |
| 141 |
124 settings.partialSwapEnabled = | 142 settings.partialSwapEnabled = |
125 cmd->HasSwitch(cc::switches::kEnablePartialSwap); | 143 cmd->HasSwitch(cc::switches::kEnablePartialSwap); |
126 settings.backgroundColorInsteadOfCheckerboard = | 144 settings.backgroundColorInsteadOfCheckerboard = |
127 cmd->HasSwitch(cc::switches::kBackgroundColorInsteadOfCheckerboard); | 145 cmd->HasSwitch(cc::switches::kBackgroundColorInsteadOfCheckerboard); |
128 settings.showOverdrawInTracing = | 146 settings.showOverdrawInTracing = |
129 cmd->HasSwitch(cc::switches::kTraceOverdraw); | 147 cmd->HasSwitch(cc::switches::kTraceOverdraw); |
130 | 148 |
131 settings.initialDebugState.showFPSCounter = web_settings.showFPSCounter; | 149 settings.initialDebugState.showFPSCounter = web_settings.showFPSCounter; |
132 settings.initialDebugState.showPaintRects = web_settings.showPaintRects; | 150 settings.initialDebugState.showPaintRects = web_settings.showPaintRects; |
133 settings.initialDebugState.showPlatformLayerTree = | 151 settings.initialDebugState.showPlatformLayerTree = |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 widget_->didCompleteSwapBuffers(); | 434 widget_->didCompleteSwapBuffers(); |
417 } | 435 } |
418 | 436 |
419 // TODO(jamesr): This goes through WebViewImpl just to do suppression, refactor | 437 // TODO(jamesr): This goes through WebViewImpl just to do suppression, refactor |
420 // that piece out. | 438 // that piece out. |
421 void RenderWidgetCompositor::scheduleComposite() { | 439 void RenderWidgetCompositor::scheduleComposite() { |
422 client_->scheduleComposite(); | 440 client_->scheduleComposite(); |
423 } | 441 } |
424 | 442 |
425 } // namespace content | 443 } // namespace content |
OLD | NEW |