| 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 "cc/font_atlas.h" | 9 #include "cc/font_atlas.h" |
| 9 #include "cc/input_handler.h" | 10 #include "cc/input_handler.h" |
| 10 #include "cc/layer.h" | 11 #include "cc/layer.h" |
| 11 #include "cc/layer_tree_host.h" | 12 #include "cc/layer_tree_host.h" |
| 12 #include "cc/switches.h" | 13 #include "cc/switches.h" |
| 13 #include "cc/thread.h" | 14 #include "cc/thread.h" |
| 14 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3
D.h" | 15 #include "third_party/WebKit/Source/Platform/chromium/public/WebGraphicsContext3
D.h" |
| 15 #include "third_party/WebKit/Source/Platform/chromium/public/WebInputHandler.h" | 16 #include "third_party/WebKit/Source/Platform/chromium/public/WebInputHandler.h" |
| 16 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayer.h" | 17 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayer.h" |
| 17 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeViewCli
ent.h" | 18 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerTreeViewCli
ent.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 44 settings.acceleratedAnimationEnabled = webSettings.acceleratedAnimationEnabl
ed; | 45 settings.acceleratedAnimationEnabled = webSettings.acceleratedAnimationEnabl
ed; |
| 45 settings.pageScalePinchZoomEnabled = webSettings.pageScalePinchZoomEnabled; | 46 settings.pageScalePinchZoomEnabled = webSettings.pageScalePinchZoomEnabled; |
| 46 settings.refreshRate = webSettings.refreshRate; | 47 settings.refreshRate = webSettings.refreshRate; |
| 47 settings.defaultTileSize = webSettings.defaultTileSize; | 48 settings.defaultTileSize = webSettings.defaultTileSize; |
| 48 settings.maxUntiledLayerSize = webSettings.maxUntiledLayerSize; | 49 settings.maxUntiledLayerSize = webSettings.maxUntiledLayerSize; |
| 49 settings.initialDebugState.showFPSCounter = webSettings.showFPSCounter; | 50 settings.initialDebugState.showFPSCounter = webSettings.showFPSCounter; |
| 50 settings.initialDebugState.showPaintRects = webSettings.showPaintRects; | 51 settings.initialDebugState.showPaintRects = webSettings.showPaintRects; |
| 51 settings.initialDebugState.showPlatformLayerTree = webSettings.showPlatformL
ayerTree; | 52 settings.initialDebugState.showPlatformLayerTree = webSettings.showPlatformL
ayerTree; |
| 52 settings.initialDebugState.showDebugBorders = webSettings.showDebugBorders; | 53 settings.initialDebugState.showDebugBorders = webSettings.showDebugBorders; |
| 53 settings.implSidePainting = CommandLine::ForCurrentProcess()->HasSwitch(cc::
switches::kEnableImplSidePainting); | 54 settings.implSidePainting = CommandLine::ForCurrentProcess()->HasSwitch(cc::
switches::kEnableImplSidePainting); |
| 55 |
| 56 settings.calculateTopControlsPosition = CommandLine::ForCurrentProcess()->Ha
sSwitch(switches::kEnableTopControlsPositionCalculation); |
| 57 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kTopControlsHeight
)) { |
| 58 std::string controls_height_str = |
| 59 CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kTop
ControlsHeight); |
| 60 int controls_height; |
| 61 if (base::StringToInt(controls_height_str, &controls_height) && controls
_height > 0) |
| 62 settings.topControlsHeightPx = controls_height; |
| 63 } |
| 64 if (settings.calculateTopControlsPosition && (settings.topControlsHeightPx <
= 0 || !settings.compositorFrameMessage)) { |
| 65 DCHECK(false) << "Top controls repositioning enabled without valid heigh
t or compositorFrameMessage set."; |
| 66 settings.calculateTopControlsPosition = false; |
| 67 } |
| 68 |
| 54 m_layerTreeHost = LayerTreeHost::create(this, settings, implThread.Pass()); | 69 m_layerTreeHost = LayerTreeHost::create(this, settings, implThread.Pass()); |
| 55 if (!m_layerTreeHost.get()) | 70 if (!m_layerTreeHost.get()) |
| 56 return false; | 71 return false; |
| 57 return true; | 72 return true; |
| 58 } | 73 } |
| 59 | 74 |
| 60 void WebLayerTreeViewImpl::setSurfaceReady() | 75 void WebLayerTreeViewImpl::setSurfaceReady() |
| 61 { | 76 { |
| 62 m_layerTreeHost->setSurfaceReady(); | 77 m_layerTreeHost->setSurfaceReady(); |
| 63 } | 78 } |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 { | 298 { |
| 284 m_client->didCompleteSwapBuffers(); | 299 m_client->didCompleteSwapBuffers(); |
| 285 } | 300 } |
| 286 | 301 |
| 287 void WebLayerTreeViewImpl::scheduleComposite() | 302 void WebLayerTreeViewImpl::scheduleComposite() |
| 288 { | 303 { |
| 289 m_client->scheduleComposite(); | 304 m_client->scheduleComposite(); |
| 290 } | 305 } |
| 291 | 306 |
| 292 } // namespace WebKit | 307 } // namespace WebKit |
| OLD | NEW |