| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 | 55 |
| 56 void WebLayerTreeViewImplForTesting::setRootLayer(const blink::WebLayer& root) { | 56 void WebLayerTreeViewImplForTesting::setRootLayer(const blink::WebLayer& root) { |
| 57 m_layerTreeHost->GetLayerTree()->SetRootLayer( | 57 m_layerTreeHost->GetLayerTree()->SetRootLayer( |
| 58 static_cast<const cc_blink::WebLayerImpl*>(&root)->layer()); | 58 static_cast<const cc_blink::WebLayerImpl*>(&root)->layer()); |
| 59 } | 59 } |
| 60 | 60 |
| 61 void WebLayerTreeViewImplForTesting::clearRootLayer() { | 61 void WebLayerTreeViewImplForTesting::clearRootLayer() { |
| 62 m_layerTreeHost->GetLayerTree()->SetRootLayer(scoped_refptr<cc::Layer>()); | 62 m_layerTreeHost->GetLayerTree()->SetRootLayer(scoped_refptr<cc::Layer>()); |
| 63 } | 63 } |
| 64 | 64 |
| 65 void WebLayerTreeViewImplForTesting::attachCompositorAnimationTimeline( | 65 cc::AnimationHost* WebLayerTreeViewImplForTesting::compositorAnimationHost() { |
| 66 cc::AnimationTimeline* compositorTimeline) { | 66 return m_animationHost.get(); |
| 67 DCHECK(m_animationHost); | |
| 68 m_animationHost->AddAnimationTimeline(compositorTimeline); | |
| 69 } | |
| 70 | |
| 71 void WebLayerTreeViewImplForTesting::detachCompositorAnimationTimeline( | |
| 72 cc::AnimationTimeline* compositorTimeline) { | |
| 73 DCHECK(m_animationHost); | |
| 74 m_animationHost->RemoveAnimationTimeline(compositorTimeline); | |
| 75 } | 67 } |
| 76 | 68 |
| 77 void WebLayerTreeViewImplForTesting::setViewportSize( | 69 void WebLayerTreeViewImplForTesting::setViewportSize( |
| 78 const WebSize& unusedDeprecated, | 70 const WebSize& unusedDeprecated, |
| 79 const WebSize& deviceViewportSize) { | 71 const WebSize& deviceViewportSize) { |
| 80 gfx::Size gfxSize(std::max(0, deviceViewportSize.width), | 72 gfx::Size gfxSize(std::max(0, deviceViewportSize.width), |
| 81 std::max(0, deviceViewportSize.height)); | 73 std::max(0, deviceViewportSize.height)); |
| 82 m_layerTreeHost->GetLayerTree()->SetViewportSize(gfxSize); | 74 m_layerTreeHost->GetLayerTree()->SetViewportSize(gfxSize); |
| 83 } | 75 } |
| 84 | 76 |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 void WebLayerTreeViewImplForTesting::setHaveScrollEventHandlers( | 206 void WebLayerTreeViewImplForTesting::setHaveScrollEventHandlers( |
| 215 bool haveEentHandlers) { | 207 bool haveEentHandlers) { |
| 216 m_layerTreeHost->GetLayerTree()->SetHaveScrollEventHandlers(haveEentHandlers); | 208 m_layerTreeHost->GetLayerTree()->SetHaveScrollEventHandlers(haveEentHandlers); |
| 217 } | 209 } |
| 218 | 210 |
| 219 bool WebLayerTreeViewImplForTesting::haveScrollEventHandlers() const { | 211 bool WebLayerTreeViewImplForTesting::haveScrollEventHandlers() const { |
| 220 return m_layerTreeHost->GetLayerTree()->have_scroll_event_handlers(); | 212 return m_layerTreeHost->GetLayerTree()->have_scroll_event_handlers(); |
| 221 } | 213 } |
| 222 | 214 |
| 223 } // namespace blink | 215 } // namespace blink |
| OLD | NEW |