| 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 #ifndef WebLayerTreeViewImplForTesting_h | 5 #ifndef WebLayerTreeViewImplForTesting_h |
| 6 #define WebLayerTreeViewImplForTesting_h | 6 #define WebLayerTreeViewImplForTesting_h |
| 7 | 7 |
| 8 #include "cc/test/test_task_graph_runner.h" | 8 #include "cc/test/test_task_graph_runner.h" |
| 9 #include "cc/trees/layer_tree_host_client.h" | 9 #include "cc/trees/layer_tree_host_client.h" |
| 10 #include "cc/trees/layer_tree_host_single_thread_client.h" | 10 #include "cc/trees/layer_tree_host_single_thread_client.h" |
| 11 #include "public/platform/WebLayerTreeView.h" | 11 #include "public/platform/WebLayerTreeView.h" |
| 12 #include <memory> | 12 #include <memory> |
| 13 | 13 |
| 14 namespace cc { | 14 namespace cc { |
| 15 class LayerTreeHost; | 15 class LayerTreeHostInterface; |
| 16 class LayerTreeSettings; | 16 class LayerTreeSettings; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace blink { | 19 namespace blink { |
| 20 | 20 |
| 21 class WebCompositorAnimationTimeline; | 21 class WebCompositorAnimationTimeline; |
| 22 class WebLayer; | 22 class WebLayer; |
| 23 | 23 |
| 24 // Dummy WeblayerTeeView that does not support any actual compositing. | 24 // Dummy WeblayerTeeView that does not support any actual compositing. |
| 25 class WebLayerTreeViewImplForTesting : public blink::WebLayerTreeView, | 25 class WebLayerTreeViewImplForTesting : public blink::WebLayerTreeView, |
| 26 public cc::LayerTreeHostClient, | 26 public cc::LayerTreeHostClient, |
| 27 public cc::LayerTreeHostSingleThreadClient { | 27 public cc::LayerTreeHostSingleThreadClient { |
| 28 WTF_MAKE_NONCOPYABLE(WebLayerTreeViewImplForTesting); | 28 WTF_MAKE_NONCOPYABLE(WebLayerTreeViewImplForTesting); |
| 29 public: | 29 public: |
| 30 WebLayerTreeViewImplForTesting(); | 30 WebLayerTreeViewImplForTesting(); |
| 31 explicit WebLayerTreeViewImplForTesting(const cc::LayerTreeSettings&); | 31 explicit WebLayerTreeViewImplForTesting(const cc::LayerTreeSettings&); |
| 32 ~WebLayerTreeViewImplForTesting() override; | 32 ~WebLayerTreeViewImplForTesting() override; |
| 33 | 33 |
| 34 static cc::LayerTreeSettings defaultLayerTreeSettings(); | 34 static cc::LayerTreeSettings defaultLayerTreeSettings(); |
| 35 cc::LayerTreeHost* layerTreeHost() { return m_layerTreeHost.get(); } | 35 cc::LayerTreeHostInterface* layerTreeHost() { return m_layerTreeHost.get();
} |
| 36 bool hasLayer(const WebLayer&); | 36 bool hasLayer(const WebLayer&); |
| 37 | 37 |
| 38 // blink::WebLayerTreeView implementation. | 38 // blink::WebLayerTreeView implementation. |
| 39 void setRootLayer(const blink::WebLayer&) override; | 39 void setRootLayer(const blink::WebLayer&) override; |
| 40 void clearRootLayer() override; | 40 void clearRootLayer() override; |
| 41 void attachCompositorAnimationTimeline(cc::AnimationTimeline*) override; | 41 void attachCompositorAnimationTimeline(cc::AnimationTimeline*) override; |
| 42 void detachCompositorAnimationTimeline(cc::AnimationTimeline*) override; | 42 void detachCompositorAnimationTimeline(cc::AnimationTimeline*) override; |
| 43 virtual void setViewportSize(const blink::WebSize& unusedDeprecated, | 43 virtual void setViewportSize(const blink::WebSize& unusedDeprecated, |
| 44 const blink::WebSize& deviceViewportSize); | 44 const blink::WebSize& deviceViewportSize); |
| 45 void setViewportSize(const blink::WebSize&) override; | 45 void setViewportSize(const blink::WebSize&) override; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 void DidCommitAndDrawFrame() override {} | 92 void DidCommitAndDrawFrame() override {} |
| 93 void DidCompleteSwapBuffers() override {} | 93 void DidCompleteSwapBuffers() override {} |
| 94 void DidCompletePageScaleAnimation() override {} | 94 void DidCompletePageScaleAnimation() override {} |
| 95 | 95 |
| 96 // cc::LayerTreeHostSingleThreadClient implementation. | 96 // cc::LayerTreeHostSingleThreadClient implementation. |
| 97 void DidPostSwapBuffers() override {} | 97 void DidPostSwapBuffers() override {} |
| 98 void DidAbortSwapBuffers() override {} | 98 void DidAbortSwapBuffers() override {} |
| 99 | 99 |
| 100 private: | 100 private: |
| 101 cc::TestTaskGraphRunner m_taskGraphRunner; | 101 cc::TestTaskGraphRunner m_taskGraphRunner; |
| 102 std::unique_ptr<cc::LayerTreeHost> m_layerTreeHost; | 102 std::unique_ptr<cc::LayerTreeHostInterface> m_layerTreeHost; |
| 103 }; | 103 }; |
| 104 | 104 |
| 105 } // namespace blink | 105 } // namespace blink |
| 106 | 106 |
| 107 #endif // WebLayerTreeViewImplForTesting_h | 107 #endif // WebLayerTreeViewImplForTesting_h |
| OLD | NEW |