OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "platform/testing/WebLayerTreeViewImplForTesting.h" | 5 #include "platform/testing/WebLayerTreeViewImplForTesting.h" |
6 | 6 |
7 #include "base/threading/thread_task_runner_handle.h" | 7 #include "base/threading/thread_task_runner_handle.h" |
8 #include "cc/animation/animation_host.h" | 8 #include "cc/animation/animation_host.h" |
9 #include "cc/animation/animation_timeline.h" | 9 #include "cc/animation/animation_timeline.h" |
10 #include "cc/blink/web_layer_impl.h" | 10 #include "cc/blink/web_layer_impl.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 gfx::Size gfxSize(std::max(0, deviceViewportSize.width), std::max(0, deviceV
iewportSize.height)); | 92 gfx::Size gfxSize(std::max(0, deviceViewportSize.width), std::max(0, deviceV
iewportSize.height)); |
93 m_layerTreeHost->GetLayerTree()->SetViewportSize(gfxSize); | 93 m_layerTreeHost->GetLayerTree()->SetViewportSize(gfxSize); |
94 } | 94 } |
95 | 95 |
96 void WebLayerTreeViewImplForTesting::setViewportSize(const WebSize& deviceViewpo
rtSize) | 96 void WebLayerTreeViewImplForTesting::setViewportSize(const WebSize& deviceViewpo
rtSize) |
97 { | 97 { |
98 gfx::Size gfxSize(std::max(0, deviceViewportSize.width), std::max(0, deviceV
iewportSize.height)); | 98 gfx::Size gfxSize(std::max(0, deviceViewportSize.width), std::max(0, deviceV
iewportSize.height)); |
99 m_layerTreeHost->GetLayerTree()->SetViewportSize(gfxSize); | 99 m_layerTreeHost->GetLayerTree()->SetViewportSize(gfxSize); |
100 } | 100 } |
101 | 101 |
| 102 WebSize WebLayerTreeViewImplForTesting::getViewportSize() const |
| 103 { |
| 104 return WebSize( |
| 105 m_layerTreeHost->GetLayerTree()->device_viewport_size().width(), |
| 106 m_layerTreeHost->GetLayerTree()->device_viewport_size().height()); |
| 107 } |
| 108 |
102 void WebLayerTreeViewImplForTesting::setDeviceScaleFactor(float deviceScaleFacto
r) | 109 void WebLayerTreeViewImplForTesting::setDeviceScaleFactor(float deviceScaleFacto
r) |
103 { | 110 { |
104 m_layerTreeHost->GetLayerTree()->SetDeviceScaleFactor(deviceScaleFactor); | 111 m_layerTreeHost->GetLayerTree()->SetDeviceScaleFactor(deviceScaleFactor); |
105 } | 112 } |
106 | 113 |
107 void WebLayerTreeViewImplForTesting::setBackgroundColor(WebColor color) | 114 void WebLayerTreeViewImplForTesting::setBackgroundColor(WebColor color) |
108 { | 115 { |
109 m_layerTreeHost->GetLayerTree()->set_background_color(color); | 116 m_layerTreeHost->GetLayerTree()->set_background_color(color); |
110 } | 117 } |
111 | 118 |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 { | 235 { |
229 m_layerTreeHost->GetLayerTree()->SetHaveScrollEventHandlers(haveEentHandlers
); | 236 m_layerTreeHost->GetLayerTree()->SetHaveScrollEventHandlers(haveEentHandlers
); |
230 } | 237 } |
231 | 238 |
232 bool WebLayerTreeViewImplForTesting::haveScrollEventHandlers() const | 239 bool WebLayerTreeViewImplForTesting::haveScrollEventHandlers() const |
233 { | 240 { |
234 return m_layerTreeHost->GetLayerTree()->have_scroll_event_handlers(); | 241 return m_layerTreeHost->GetLayerTree()->have_scroll_event_handlers(); |
235 } | 242 } |
236 | 243 |
237 } // namespace blink | 244 } // namespace blink |
OLD | NEW |