OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 "web_layer_tree_view_impl.h" | 5 #include "web_layer_tree_view_impl.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
9 #include "cc/font_atlas.h" | 9 #include "cc/font_atlas.h" |
10 #include "cc/input_handler.h" | 10 #include "cc/input_handler.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 settings.initialDebugState.showFPSCounter = webSettings.showFPSCounter; | 51 settings.initialDebugState.showFPSCounter = webSettings.showFPSCounter; |
52 settings.initialDebugState.showPaintRects = webSettings.showPaintRects; | 52 settings.initialDebugState.showPaintRects = webSettings.showPaintRects; |
53 settings.initialDebugState.showPlatformLayerTree = webSettings.showPlatformL
ayerTree; | 53 settings.initialDebugState.showPlatformLayerTree = webSettings.showPlatformL
ayerTree; |
54 settings.initialDebugState.showDebugBorders = webSettings.showDebugBorders; | 54 settings.initialDebugState.showDebugBorders = webSettings.showDebugBorders; |
55 settings.implSidePainting = CommandLine::ForCurrentProcess()->HasSwitch(cc::
switches::kEnableImplSidePainting); | 55 settings.implSidePainting = CommandLine::ForCurrentProcess()->HasSwitch(cc::
switches::kEnableImplSidePainting); |
56 | 56 |
57 settings.calculateTopControlsPosition = CommandLine::ForCurrentProcess()->Ha
sSwitch(switches::kEnableTopControlsPositionCalculation); | 57 settings.calculateTopControlsPosition = CommandLine::ForCurrentProcess()->Ha
sSwitch(switches::kEnableTopControlsPositionCalculation); |
58 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kTopControlsHeight
)) { | 58 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kTopControlsHeight
)) { |
59 std::string controls_height_str = | 59 std::string controls_height_str = |
60 CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kTop
ControlsHeight); | 60 CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kTop
ControlsHeight); |
61 int controls_height; | 61 double controls_height; |
62 if (base::StringToInt(controls_height_str, &controls_height) && controls
_height > 0) | 62 if (base::StringToDouble(controls_height_str, &controls_height) && contr
ols_height > 0) |
63 settings.topControlsHeightPx = controls_height; | 63 settings.topControlsHeight = controls_height; |
64 } | 64 } |
65 if (settings.calculateTopControlsPosition && (settings.topControlsHeightPx <
= 0 || !settings.compositorFrameMessage)) { | 65 if (settings.calculateTopControlsPosition && (settings.topControlsHeight <=
0 || !settings.compositorFrameMessage)) { |
66 DCHECK(false) << "Top controls repositioning enabled without valid heigh
t or compositorFrameMessage set."; | 66 DCHECK(false) << "Top controls repositioning enabled without valid heigh
t or compositorFrameMessage set."; |
67 settings.calculateTopControlsPosition = false; | 67 settings.calculateTopControlsPosition = false; |
68 } | 68 } |
69 | 69 |
70 m_layerTreeHost = LayerTreeHost::create(this, settings, implThread.Pass()); | 70 m_layerTreeHost = LayerTreeHost::create(this, settings, implThread.Pass()); |
71 if (!m_layerTreeHost.get()) | 71 if (!m_layerTreeHost.get()) |
72 return false; | 72 return false; |
73 return true; | 73 return true; |
74 } | 74 } |
75 | 75 |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 { | 304 { |
305 m_client->didCompleteSwapBuffers(); | 305 m_client->didCompleteSwapBuffers(); |
306 } | 306 } |
307 | 307 |
308 void WebLayerTreeViewImpl::scheduleComposite() | 308 void WebLayerTreeViewImpl::scheduleComposite() |
309 { | 309 { |
310 m_client->scheduleComposite(); | 310 m_client->scheduleComposite(); |
311 } | 311 } |
312 | 312 |
313 } // namespace WebKit | 313 } // namespace WebKit |
OLD | NEW |