| 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 28 matching lines...) Expand all Loading... |
| 39 CompositorMode mode, | 39 CompositorMode mode, |
| 40 InitParams params); | 40 InitParams params); |
| 41 static std::unique_ptr<FakeLayerTreeHost> Create( | 41 static std::unique_ptr<FakeLayerTreeHost> Create( |
| 42 FakeLayerTreeHostClient* client, | 42 FakeLayerTreeHostClient* client, |
| 43 TestTaskGraphRunner* task_graph_runner, | 43 TestTaskGraphRunner* task_graph_runner, |
| 44 const LayerTreeSettings& settings, | 44 const LayerTreeSettings& settings, |
| 45 CompositorMode mode, | 45 CompositorMode mode, |
| 46 ImageSerializationProcessor* image_serialization_processor); | 46 ImageSerializationProcessor* image_serialization_processor); |
| 47 ~FakeLayerTreeHost() override; | 47 ~FakeLayerTreeHost() override; |
| 48 | 48 |
| 49 const RendererCapabilities& GetRendererCapabilities() const override; | |
| 50 void SetNeedsCommit() override; | 49 void SetNeedsCommit() override; |
| 51 void SetNeedsUpdateLayers() override {} | 50 void SetNeedsUpdateLayers() override {} |
| 52 | 51 |
| 53 void SetRootLayer(scoped_refptr<Layer> root_layer) { | 52 void SetRootLayer(scoped_refptr<Layer> root_layer) { |
| 54 layer_tree_->SetRootLayer(root_layer); | 53 layer_tree_->SetRootLayer(root_layer); |
| 55 } | 54 } |
| 56 Layer* root_layer() const { return layer_tree_->root_layer(); } | 55 Layer* root_layer() const { return layer_tree_->root_layer(); } |
| 57 PropertyTrees* property_trees() const { | 56 PropertyTrees* property_trees() const { |
| 58 return layer_tree_->property_trees(); | 57 return layer_tree_->property_trees(); |
| 59 } | 58 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 74 using LayerTreeHost::RecordGpuRasterizationHistogram; | 73 using LayerTreeHost::RecordGpuRasterizationHistogram; |
| 75 | 74 |
| 76 void UpdateLayers() { LayerTreeHost::UpdateLayers(); } | 75 void UpdateLayers() { LayerTreeHost::UpdateLayers(); } |
| 77 | 76 |
| 78 MicroBenchmarkController* GetMicroBenchmarkController() { | 77 MicroBenchmarkController* GetMicroBenchmarkController() { |
| 79 return µ_benchmark_controller_; | 78 return µ_benchmark_controller_; |
| 80 } | 79 } |
| 81 | 80 |
| 82 bool needs_commit() { return needs_commit_; } | 81 bool needs_commit() { return needs_commit_; } |
| 83 | 82 |
| 84 void set_renderer_capabilities(const RendererCapabilities& capabilities) { | |
| 85 renderer_capabilities_set = true; | |
| 86 renderer_capabilities = capabilities; | |
| 87 } | |
| 88 | |
| 89 protected: | 83 protected: |
| 90 FakeLayerTreeHost(FakeLayerTreeHostClient* client, | 84 FakeLayerTreeHost(FakeLayerTreeHostClient* client, |
| 91 LayerTreeHost::InitParams* params, | 85 LayerTreeHost::InitParams* params, |
| 92 CompositorMode mode); | 86 CompositorMode mode); |
| 93 | 87 |
| 94 private: | 88 private: |
| 95 FakeImplTaskRunnerProvider task_runner_provider_; | 89 FakeImplTaskRunnerProvider task_runner_provider_; |
| 96 FakeLayerTreeHostClient* client_; | 90 FakeLayerTreeHostClient* client_; |
| 97 TestSharedBitmapManager manager_; | 91 TestSharedBitmapManager manager_; |
| 98 FakeLayerTreeHostImpl host_impl_; | 92 FakeLayerTreeHostImpl host_impl_; |
| 99 bool needs_commit_; | 93 bool needs_commit_; |
| 100 | |
| 101 bool renderer_capabilities_set; | |
| 102 RendererCapabilities renderer_capabilities; | |
| 103 }; | 94 }; |
| 104 | 95 |
| 105 } // namespace cc | 96 } // namespace cc |
| 106 | 97 |
| 107 #endif // CC_TEST_FAKE_LAYER_TREE_HOST_H_ | 98 #endif // CC_TEST_FAKE_LAYER_TREE_HOST_H_ |
| OLD | NEW |