| 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 |
| 114 float WebLayerTreeViewImplForTesting::getDeviceScaleFactor() const |
| 115 { |
| 116 return m_layerTreeHost->GetLayerTree()->device_scale_factor(); |
| 117 } |
| 118 |
| 107 void WebLayerTreeViewImplForTesting::setBackgroundColor(WebColor color) | 119 void WebLayerTreeViewImplForTesting::setBackgroundColor(WebColor color) |
| 108 { | 120 { |
| 109 m_layerTreeHost->GetLayerTree()->set_background_color(color); | 121 m_layerTreeHost->GetLayerTree()->set_background_color(color); |
| 110 } | 122 } |
| 111 | 123 |
| 112 void WebLayerTreeViewImplForTesting::setHasTransparentBackground(bool transparen
t) | 124 void WebLayerTreeViewImplForTesting::setHasTransparentBackground(bool transparen
t) |
| 113 { | 125 { |
| 114 m_layerTreeHost->GetLayerTree()->set_has_transparent_background(transparent)
; | 126 m_layerTreeHost->GetLayerTree()->set_has_transparent_background(transparent)
; |
| 115 } | 127 } |
| 116 | 128 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 { | 240 { |
| 229 m_layerTreeHost->GetLayerTree()->SetHaveScrollEventHandlers(haveEentHandlers
); | 241 m_layerTreeHost->GetLayerTree()->SetHaveScrollEventHandlers(haveEentHandlers
); |
| 230 } | 242 } |
| 231 | 243 |
| 232 bool WebLayerTreeViewImplForTesting::haveScrollEventHandlers() const | 244 bool WebLayerTreeViewImplForTesting::haveScrollEventHandlers() const |
| 233 { | 245 { |
| 234 return m_layerTreeHost->GetLayerTree()->have_scroll_event_handlers(); | 246 return m_layerTreeHost->GetLayerTree()->have_scroll_event_handlers(); |
| 235 } | 247 } |
| 236 | 248 |
| 237 } // namespace blink | 249 } // namespace blink |
| OLD | NEW |