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" |
(...skipping 10 matching lines...) Expand all Loading... |
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 enum LayerListPolicy { DontUseLayerLists, UseLayerLists }; |
| 32 explicit WebLayerTreeViewImplForTesting(LayerListPolicy); |
31 explicit WebLayerTreeViewImplForTesting(const cc::LayerTreeSettings&); | 33 explicit WebLayerTreeViewImplForTesting(const cc::LayerTreeSettings&); |
32 ~WebLayerTreeViewImplForTesting() override; | 34 ~WebLayerTreeViewImplForTesting() override; |
33 | 35 |
34 static cc::LayerTreeSettings defaultLayerTreeSettings(); | 36 static cc::LayerTreeSettings defaultLayerTreeSettings(); |
35 cc::LayerTreeHost* layerTreeHost() { return m_layerTreeHost.get(); } | 37 cc::LayerTreeHost* layerTreeHost() { return m_layerTreeHost.get(); } |
| 38 bool hasLayer(const WebLayer&); |
36 | 39 |
37 // blink::WebLayerTreeView implementation. | 40 // blink::WebLayerTreeView implementation. |
38 void setRootLayer(const blink::WebLayer&) override; | 41 void setRootLayer(const blink::WebLayer&) override; |
39 void clearRootLayer() override; | 42 void clearRootLayer() override; |
40 void attachCompositorAnimationTimeline(cc::AnimationTimeline*) override; | 43 void attachCompositorAnimationTimeline(cc::AnimationTimeline*) override; |
41 void detachCompositorAnimationTimeline(cc::AnimationTimeline*) override; | 44 void detachCompositorAnimationTimeline(cc::AnimationTimeline*) override; |
42 virtual void setViewportSize(const blink::WebSize& unusedDeprecated, | 45 virtual void setViewportSize(const blink::WebSize& unusedDeprecated, |
43 const blink::WebSize& deviceViewportSize); | 46 const blink::WebSize& deviceViewportSize); |
44 void setViewportSize(const blink::WebSize&) override; | 47 void setViewportSize(const blink::WebSize&) override; |
45 void setDeviceScaleFactor(float) override; | 48 void setDeviceScaleFactor(float) override; |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 void DidAbortSwapBuffers() override {} | 100 void DidAbortSwapBuffers() override {} |
98 | 101 |
99 private: | 102 private: |
100 cc::TestTaskGraphRunner m_taskGraphRunner; | 103 cc::TestTaskGraphRunner m_taskGraphRunner; |
101 std::unique_ptr<cc::LayerTreeHost> m_layerTreeHost; | 104 std::unique_ptr<cc::LayerTreeHost> m_layerTreeHost; |
102 }; | 105 }; |
103 | 106 |
104 } // namespace blink | 107 } // namespace blink |
105 | 108 |
106 #endif // WebLayerTreeViewImplForTesting_h | 109 #endif // WebLayerTreeViewImplForTesting_h |
OLD | NEW |