| 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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 { | 167 { |
| 168 ASSERT_NOT_REACHED(); | 168 ASSERT_NOT_REACHED(); |
| 169 } | 169 } |
| 170 | 170 |
| 171 void WebLayerTreeViewImplForTesting::registerViewportLayers( | 171 void WebLayerTreeViewImplForTesting::registerViewportLayers( |
| 172 const blink::WebLayer* overscrollElasticityLayer, | 172 const blink::WebLayer* overscrollElasticityLayer, |
| 173 const blink::WebLayer* pageScaleLayer, | 173 const blink::WebLayer* pageScaleLayer, |
| 174 const blink::WebLayer* innerViewportScrollLayer, | 174 const blink::WebLayer* innerViewportScrollLayer, |
| 175 const blink::WebLayer* outerViewportScrollLayer) | 175 const blink::WebLayer* outerViewportScrollLayer) |
| 176 { | 176 { |
| 177 m_layerTreeHost->RegisterViewportLayers( | 177 m_layerTreeHost->GetLayerTree()->RegisterViewportLayers( |
| 178 // The scroll elasticity layer will only exist when using pinch virtual | 178 // The scroll elasticity layer will only exist when using pinch virtual |
| 179 // viewports. | 179 // viewports. |
| 180 overscrollElasticityLayer | 180 overscrollElasticityLayer |
| 181 ? static_cast<const cc_blink::WebLayerImpl*>(overscrollElasticityLay
er)->layer() | 181 ? static_cast<const cc_blink::WebLayerImpl*>(overscrollElasticityLay
er)->layer() |
| 182 : nullptr, | 182 : nullptr, |
| 183 static_cast<const cc_blink::WebLayerImpl*>(pageScaleLayer)->layer(), | 183 static_cast<const cc_blink::WebLayerImpl*>(pageScaleLayer)->layer(), |
| 184 static_cast<const cc_blink::WebLayerImpl*>(innerViewportScrollLayer)->la
yer(), | 184 static_cast<const cc_blink::WebLayerImpl*>(innerViewportScrollLayer)->la
yer(), |
| 185 // The outer viewport layer will only exist when using pinch virtual | 185 // The outer viewport layer will only exist when using pinch virtual |
| 186 // viewports. | 186 // viewports. |
| 187 outerViewportScrollLayer | 187 outerViewportScrollLayer |
| 188 ? static_cast<const cc_blink::WebLayerImpl*>(outerViewportScrollLaye
r)->layer() | 188 ? static_cast<const cc_blink::WebLayerImpl*>(outerViewportScrollLaye
r)->layer() |
| 189 : nullptr); | 189 : nullptr); |
| 190 } | 190 } |
| 191 | 191 |
| 192 void WebLayerTreeViewImplForTesting::clearViewportLayers() | 192 void WebLayerTreeViewImplForTesting::clearViewportLayers() |
| 193 { | 193 { |
| 194 m_layerTreeHost->RegisterViewportLayers(scoped_refptr<cc::Layer>(), | 194 m_layerTreeHost->GetLayerTree()->RegisterViewportLayers(scoped_refptr<cc::La
yer>(), |
| 195 scoped_refptr<cc::Layer>(), | 195 scoped_refptr<cc::Layer>(), |
| 196 scoped_refptr<cc::Layer>(), | 196 scoped_refptr<cc::Layer>(), |
| 197 scoped_refptr<cc::Layer>()); | 197 scoped_refptr<cc::Layer>()); |
| 198 } | 198 } |
| 199 | 199 |
| 200 void WebLayerTreeViewImplForTesting::registerSelection(const blink::WebSelection
& selection) | 200 void WebLayerTreeViewImplForTesting::registerSelection(const blink::WebSelection
& selection) |
| 201 { | 201 { |
| 202 } | 202 } |
| 203 | 203 |
| 204 void WebLayerTreeViewImplForTesting::clearSelection() | 204 void WebLayerTreeViewImplForTesting::clearSelection() |
| (...skipping 23 matching lines...) Expand all 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 |