| 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 <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 | 161 |
| 162 if (cmd->HasSwitch(cc::switches::kTopControlsHideThreshold)) { | 162 if (cmd->HasSwitch(cc::switches::kTopControlsHideThreshold)) { |
| 163 std::string top_threshold_str = | 163 std::string top_threshold_str = |
| 164 cmd->GetSwitchValueASCII(cc::switches::kTopControlsHideThreshold); | 164 cmd->GetSwitchValueASCII(cc::switches::kTopControlsHideThreshold); |
| 165 double hide_threshold; | 165 double hide_threshold; |
| 166 if (base::StringToDouble(top_threshold_str, &hide_threshold) && | 166 if (base::StringToDouble(top_threshold_str, &hide_threshold) && |
| 167 hide_threshold >= 0.f && hide_threshold <= 1.f) | 167 hide_threshold >= 0.f && hide_threshold <= 1.f) |
| 168 settings.topControlsHideThreshold = hide_threshold; | 168 settings.topControlsHideThreshold = hide_threshold; |
| 169 } | 169 } |
| 170 | 170 |
| 171 settings.partialSwapEnabled = | 171 settings.partialSwapEnabled = widget->AllowPartialSwap() && |
| 172 cmd->HasSwitch(cc::switches::kEnablePartialSwap); | 172 cmd->HasSwitch(cc::switches::kEnablePartialSwap); |
| 173 settings.backgroundColorInsteadOfCheckerboard = | 173 settings.backgroundColorInsteadOfCheckerboard = |
| 174 cmd->HasSwitch(cc::switches::kBackgroundColorInsteadOfCheckerboard); | 174 cmd->HasSwitch(cc::switches::kBackgroundColorInsteadOfCheckerboard); |
| 175 settings.showOverdrawInTracing = | 175 settings.showOverdrawInTracing = |
| 176 cmd->HasSwitch(cc::switches::kTraceOverdraw); | 176 cmd->HasSwitch(cc::switches::kTraceOverdraw); |
| 177 | 177 |
| 178 settings.initialDebugState.showFPSCounter = | 178 settings.initialDebugState.showFPSCounter = |
| 179 cmd->HasSwitch(switches::kShowFPSCounter); | 179 cmd->HasSwitch(switches::kShowFPSCounter); |
| 180 settings.initialDebugState.showPaintRects = | 180 settings.initialDebugState.showPaintRects = |
| 181 cmd->HasSwitch(switches::kShowPaintRects); | 181 cmd->HasSwitch(switches::kShowPaintRects); |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 return RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); | 494 return RenderThreadImpl::current()->OffscreenContextProviderForMainThread(); |
| 495 } | 495 } |
| 496 | 496 |
| 497 scoped_refptr<cc::ContextProvider> | 497 scoped_refptr<cc::ContextProvider> |
| 498 RenderWidgetCompositor::OffscreenContextProviderForCompositorThread() { | 498 RenderWidgetCompositor::OffscreenContextProviderForCompositorThread() { |
| 499 return RenderThreadImpl::current()-> | 499 return RenderThreadImpl::current()-> |
| 500 OffscreenContextProviderForCompositorThread(); | 500 OffscreenContextProviderForCompositorThread(); |
| 501 } | 501 } |
| 502 | 502 |
| 503 } // namespace content | 503 } // namespace content |
| OLD | NEW |