| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 m_layerTreeHost->SetRootLayer(static_cast<const cc_blink::WebLayerImpl*>(&ro
ot)->layer()); | 70 m_layerTreeHost->SetRootLayer(static_cast<const cc_blink::WebLayerImpl*>(&ro
ot)->layer()); |
| 71 } | 71 } |
| 72 | 72 |
| 73 void WebLayerTreeViewImplForTesting::clearRootLayer() | 73 void WebLayerTreeViewImplForTesting::clearRootLayer() |
| 74 { | 74 { |
| 75 m_layerTreeHost->SetRootLayer(scoped_refptr<cc::Layer>()); | 75 m_layerTreeHost->SetRootLayer(scoped_refptr<cc::Layer>()); |
| 76 } | 76 } |
| 77 | 77 |
| 78 void WebLayerTreeViewImplForTesting::attachCompositorAnimationTimeline(cc::Anima
tionTimeline* compositorTimeline) | 78 void WebLayerTreeViewImplForTesting::attachCompositorAnimationTimeline(cc::Anima
tionTimeline* compositorTimeline) |
| 79 { | 79 { |
| 80 ASSERT(m_layerTreeHost->animation_host()); | 80 DCHECK(m_layerTreeHost->GetLayerTree()->animation_host()); |
| 81 m_layerTreeHost->animation_host()->AddAnimationTimeline(compositorTimeline); | 81 m_layerTreeHost->GetLayerTree()->animation_host()->AddAnimationTimeline(comp
ositorTimeline); |
| 82 } | 82 } |
| 83 | 83 |
| 84 void WebLayerTreeViewImplForTesting::detachCompositorAnimationTimeline(cc::Anima
tionTimeline* compositorTimeline) | 84 void WebLayerTreeViewImplForTesting::detachCompositorAnimationTimeline(cc::Anima
tionTimeline* compositorTimeline) |
| 85 { | 85 { |
| 86 ASSERT(m_layerTreeHost->animation_host()); | 86 DCHECK(m_layerTreeHost->GetLayerTree()->animation_host()); |
| 87 m_layerTreeHost->animation_host()->RemoveAnimationTimeline(compositorTimelin
e); | 87 m_layerTreeHost->GetLayerTree()->animation_host()->RemoveAnimationTimeline(c
ompositorTimeline); |
| 88 } | 88 } |
| 89 | 89 |
| 90 void WebLayerTreeViewImplForTesting::setViewportSize(const WebSize& unusedDeprec
ated, const WebSize& deviceViewportSize) | 90 void WebLayerTreeViewImplForTesting::setViewportSize(const WebSize& unusedDeprec
ated, const WebSize& deviceViewportSize) |
| 91 { | 91 { |
| 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->SetViewportSize(gfxSize); | 93 m_layerTreeHost->SetViewportSize(gfxSize); |
| 94 } | 94 } |
| 95 | 95 |
| 96 void WebLayerTreeViewImplForTesting::setViewportSize(const WebSize& deviceViewpo
rtSize) | 96 void WebLayerTreeViewImplForTesting::setViewportSize(const WebSize& deviceViewpo
rtSize) |
| 97 { | 97 { |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 { | 228 { |
| 229 m_layerTreeHost->SetHaveScrollEventHandlers(haveEentHandlers); | 229 m_layerTreeHost->SetHaveScrollEventHandlers(haveEentHandlers); |
| 230 } | 230 } |
| 231 | 231 |
| 232 bool WebLayerTreeViewImplForTesting::haveScrollEventHandlers() const | 232 bool WebLayerTreeViewImplForTesting::haveScrollEventHandlers() const |
| 233 { | 233 { |
| 234 return m_layerTreeHost->have_scroll_event_handlers(); | 234 return m_layerTreeHost->have_scroll_event_handlers(); |
| 235 } | 235 } |
| 236 | 236 |
| 237 } // namespace blink | 237 } // namespace blink |
| OLD | NEW |