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