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 CC_TEST_FAKE_LAYER_TREE_HOST_H_ | 5 #ifndef CC_TEST_FAKE_LAYER_TREE_HOST_H_ |
6 #define CC_TEST_FAKE_LAYER_TREE_HOST_H_ | 6 #define CC_TEST_FAKE_LAYER_TREE_HOST_H_ |
7 | 7 |
8 #include "cc/debug/micro_benchmark_controller.h" | 8 #include "cc/debug/micro_benchmark_controller.h" |
9 #include "cc/test/fake_impl_task_runner_provider.h" | 9 #include "cc/test/fake_impl_task_runner_provider.h" |
10 #include "cc/test/fake_layer_tree_host_client.h" | 10 #include "cc/test/fake_layer_tree_host_client.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 static scoped_ptr<FakeLayerTreeHost> Create( | 22 static scoped_ptr<FakeLayerTreeHost> Create( |
23 FakeLayerTreeHostClient* client, | 23 FakeLayerTreeHostClient* client, |
24 TestTaskGraphRunner* task_graph_runner); | 24 TestTaskGraphRunner* task_graph_runner); |
25 static scoped_ptr<FakeLayerTreeHost> Create( | 25 static scoped_ptr<FakeLayerTreeHost> Create( |
26 FakeLayerTreeHostClient* client, | 26 FakeLayerTreeHostClient* client, |
27 TestTaskGraphRunner* task_graph_runner, | 27 TestTaskGraphRunner* task_graph_runner, |
28 const LayerTreeSettings& settings); | 28 const LayerTreeSettings& settings); |
29 | 29 |
30 ~FakeLayerTreeHost() override; | 30 ~FakeLayerTreeHost() override; |
31 | 31 |
| 32 const RendererCapabilities& GetRendererCapabilities() const override; |
32 void SetNeedsCommit() override; | 33 void SetNeedsCommit() override; |
33 void SetNeedsUpdateLayers() override {} | 34 void SetNeedsUpdateLayers() override {} |
34 void SetNeedsFullTreeSync() override {} | 35 void SetNeedsFullTreeSync() override {} |
35 | 36 |
36 using LayerTreeHost::SetRootLayer; | 37 using LayerTreeHost::SetRootLayer; |
37 using LayerTreeHost::root_layer; | 38 using LayerTreeHost::root_layer; |
38 | 39 |
39 LayerImpl* CommitAndCreateLayerImplTree(); | 40 LayerImpl* CommitAndCreateLayerImplTree(); |
40 | 41 |
41 FakeLayerTreeHostImpl* host_impl() { return &host_impl_; } | 42 FakeLayerTreeHostImpl* host_impl() { return &host_impl_; } |
42 LayerTreeImpl* active_tree() { return host_impl_.active_tree(); } | 43 LayerTreeImpl* active_tree() { return host_impl_.active_tree(); } |
43 | 44 |
44 using LayerTreeHost::ScheduleMicroBenchmark; | 45 using LayerTreeHost::ScheduleMicroBenchmark; |
45 using LayerTreeHost::SendMessageToMicroBenchmark; | 46 using LayerTreeHost::SendMessageToMicroBenchmark; |
46 using LayerTreeHost::SetOutputSurfaceLostForTesting; | 47 using LayerTreeHost::SetOutputSurfaceLostForTesting; |
47 using LayerTreeHost::InitializeSingleThreaded; | 48 using LayerTreeHost::InitializeSingleThreaded; |
48 using LayerTreeHost::InitializeForTesting; | 49 using LayerTreeHost::InitializeForTesting; |
49 void UpdateLayers() { LayerTreeHost::UpdateLayers(); } | 50 void UpdateLayers() { LayerTreeHost::UpdateLayers(); } |
50 | 51 |
51 MicroBenchmarkController* GetMicroBenchmarkController() { | 52 MicroBenchmarkController* GetMicroBenchmarkController() { |
52 return µ_benchmark_controller_; | 53 return µ_benchmark_controller_; |
53 } | 54 } |
54 | 55 |
55 bool needs_commit() { return needs_commit_; } | 56 bool needs_commit() { return needs_commit_; } |
56 | 57 |
| 58 void set_renderer_capabilities(const RendererCapabilities& capabilities) { |
| 59 renderer_capabilities_set = true; |
| 60 renderer_capabilities = capabilities; |
| 61 } |
| 62 |
57 protected: | 63 protected: |
58 FakeLayerTreeHost(FakeLayerTreeHostClient* client, | 64 FakeLayerTreeHost(FakeLayerTreeHostClient* client, |
59 LayerTreeHost::InitParams* params); | 65 LayerTreeHost::InitParams* params); |
60 | 66 |
61 private: | 67 private: |
62 FakeImplTaskRunnerProvider task_runner_provider_; | 68 FakeImplTaskRunnerProvider task_runner_provider_; |
63 FakeLayerTreeHostClient* client_; | 69 FakeLayerTreeHostClient* client_; |
64 TestSharedBitmapManager manager_; | 70 TestSharedBitmapManager manager_; |
65 FakeLayerTreeHostImpl host_impl_; | 71 FakeLayerTreeHostImpl host_impl_; |
66 bool needs_commit_; | 72 bool needs_commit_; |
| 73 |
| 74 bool renderer_capabilities_set; |
| 75 RendererCapabilities renderer_capabilities; |
67 }; | 76 }; |
68 | 77 |
69 } // namespace cc | 78 } // namespace cc |
70 | 79 |
71 #endif // CC_TEST_FAKE_LAYER_TREE_HOST_H_ | 80 #endif // CC_TEST_FAKE_LAYER_TREE_HOST_H_ |
OLD | NEW |