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/test/fake_impl_proxy.h" | 8 #include "cc/test/fake_impl_proxy.h" |
9 #include "cc/test/fake_layer_tree_host_client.h" | 9 #include "cc/test/fake_layer_tree_host_client.h" |
10 #include "cc/test/fake_layer_tree_host_impl.h" | 10 #include "cc/test/fake_layer_tree_host_impl.h" |
11 #include "cc/trees/layer_tree_host.h" | 11 #include "cc/trees/layer_tree_host.h" |
12 #include "cc/trees/layer_tree_impl.h" | 12 #include "cc/trees/layer_tree_impl.h" |
13 #include "cc/trees/tree_synchronizer.h" | 13 #include "cc/trees/tree_synchronizer.h" |
14 | 14 |
15 namespace cc { | 15 namespace cc { |
16 | 16 |
17 class FakeLayerTreeHost : protected LayerTreeHost { | 17 class FakeLayerTreeHost : public LayerTreeHost { |
18 public: | 18 public: |
19 static scoped_ptr<FakeLayerTreeHost> Create(); | 19 static scoped_ptr<FakeLayerTreeHost> Create(); |
20 | 20 |
21 static scoped_ptr<FakeLayerTreeHost> Create( | 21 static scoped_ptr<FakeLayerTreeHost> Create( |
22 const LayerTreeSettings& settings); | 22 const LayerTreeSettings& settings); |
23 | 23 |
24 virtual ~FakeLayerTreeHost() {} | 24 virtual ~FakeLayerTreeHost() {} |
25 | 25 |
26 virtual void SetNeedsCommit() OVERRIDE; | 26 virtual void SetNeedsCommit() OVERRIDE; |
27 virtual void SetNeedsFullTreeSync() OVERRIDE {} | 27 virtual void SetNeedsFullTreeSync() OVERRIDE {} |
28 | 28 |
29 using LayerTreeHost::SetRootLayer; | 29 using LayerTreeHost::SetRootLayer; |
30 using LayerTreeHost::root_layer; | 30 using LayerTreeHost::root_layer; |
31 | 31 |
32 LayerImpl* CommitAndCreateLayerImplTree(); | 32 LayerImpl* CommitAndCreateLayerImplTree(); |
33 | 33 |
34 FakeLayerTreeHostImpl* host_impl() { return &host_impl_; } | 34 FakeLayerTreeHostImpl* host_impl() { return &host_impl_; } |
35 LayerTreeImpl* active_tree() { return host_impl_.active_tree(); } | 35 LayerTreeImpl* active_tree() { return host_impl_.active_tree(); } |
36 | 36 |
37 using LayerTreeHost::ScheduleMicroBenchmark; | 37 using LayerTreeHost::ScheduleMicroBenchmark; |
38 using LayerTreeHost::SetOutputSurfaceLostForTesting; | 38 using LayerTreeHost::SetOutputSurfaceLostForTesting; |
| 39 using LayerTreeHost::InitializeSingleThreaded; |
39 using LayerTreeHost::InitializeForTesting; | 40 using LayerTreeHost::InitializeForTesting; |
40 void UpdateLayers(ResourceUpdateQueue* queue) { | 41 void UpdateLayers(ResourceUpdateQueue* queue) { |
41 LayerTreeHost::UpdateLayers(queue); | 42 LayerTreeHost::UpdateLayers(queue); |
42 } | 43 } |
43 | 44 |
44 bool needs_commit() { return needs_commit_; } | 45 bool needs_commit() { return needs_commit_; } |
45 | 46 |
46 private: | 47 private: |
47 FakeLayerTreeHost(LayerTreeHostClient* client, | 48 FakeLayerTreeHost(LayerTreeHostClient* client, |
48 const LayerTreeSettings& settings) | 49 const LayerTreeSettings& settings) |
49 : LayerTreeHost(client, NULL, settings), | 50 : LayerTreeHost(client, NULL, settings), |
50 host_impl_(settings, &proxy_), | 51 host_impl_(settings, &proxy_), |
51 needs_commit_(false) {} | 52 needs_commit_(false) {} |
52 | 53 |
53 FakeImplProxy proxy_; | 54 FakeImplProxy proxy_; |
54 FakeLayerTreeHostImpl host_impl_; | 55 FakeLayerTreeHostImpl host_impl_; |
55 bool needs_commit_; | 56 bool needs_commit_; |
56 }; | 57 }; |
57 | 58 |
58 } // namespace cc | 59 } // namespace cc |
59 | 60 |
60 #endif // CC_TEST_FAKE_LAYER_TREE_HOST_H_ | 61 #endif // CC_TEST_FAKE_LAYER_TREE_HOST_H_ |
OLD | NEW |