OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_TREES_LAYER_TREE_HOST_H_ | 5 #ifndef CC_TREES_LAYER_TREE_HOST_H_ |
6 #define CC_TREES_LAYER_TREE_HOST_H_ | 6 #define CC_TREES_LAYER_TREE_HOST_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "cc/base/cc_export.h" | 10 #include "cc/base/cc_export.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 // update(commit) pushed to the compositor thread. | 47 // update(commit) pushed to the compositor thread. |
48 virtual int SourceFrameNumber() const = 0; | 48 virtual int SourceFrameNumber() const = 0; |
49 | 49 |
50 // Returns the LayerTree that holds the main frame state pushed to the | 50 // Returns the LayerTree that holds the main frame state pushed to the |
51 // LayerTreeImpl on commit. | 51 // LayerTreeImpl on commit. |
52 virtual LayerTree* GetLayerTree() = 0; | 52 virtual LayerTree* GetLayerTree() = 0; |
53 virtual const LayerTree* GetLayerTree() const = 0; | 53 virtual const LayerTree* GetLayerTree() const = 0; |
54 | 54 |
55 // Returns the UIResourceManager used to create UIResources for | 55 // Returns the UIResourceManager used to create UIResources for |
56 // UIResourceLayers pushed to the LayerTree. | 56 // UIResourceLayers pushed to the LayerTree. |
57 virtual UIResourceManager* GetUIResourceManager() const = 0; | 57 virtual UIResourceManager* GetUIResourceManager() = 0; |
58 | 58 |
59 // Returns the TaskRunnerProvider used to access the main and compositor | 59 // Returns the TaskRunnerProvider used to access the main and compositor |
60 // thread task runners. | 60 // thread task runners. |
61 virtual TaskRunnerProvider* GetTaskRunnerProvider() const = 0; | 61 virtual TaskRunnerProvider* GetTaskRunnerProvider() const = 0; |
62 | 62 |
63 // Returns the settings used by this host. | 63 // Returns the settings used by this host. |
64 virtual const LayerTreeSettings& GetSettings() const = 0; | 64 virtual const LayerTreeSettings& GetSettings() const = 0; |
65 | 65 |
66 // Sets the client id used to generate the SurfaceId that uniquely identifies | 66 // Sets the client id used to generate the SurfaceId that uniquely identifies |
67 // the Surfaces produced by this compositor. | 67 // the Surfaces produced by this compositor. |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 | 192 |
193 // When the main thread informs the impl thread that it is ready to commit, | 193 // When the main thread informs the impl thread that it is ready to commit, |
194 // generally it would remain blocked till the main thread state is copied to | 194 // generally it would remain blocked till the main thread state is copied to |
195 // the pending tree. Calling this would ensure that the main thread remains | 195 // the pending tree. Calling this would ensure that the main thread remains |
196 // blocked till the pending tree is activated. | 196 // blocked till the pending tree is activated. |
197 virtual void SetNextCommitWaitsForActivation() = 0; | 197 virtual void SetNextCommitWaitsForActivation() = 0; |
198 | 198 |
199 // The LayerTreeHost tracks whether the content is suitable for Gpu raster. | 199 // The LayerTreeHost tracks whether the content is suitable for Gpu raster. |
200 // Calling this will reset it back to not suitable state. | 200 // Calling this will reset it back to not suitable state. |
201 virtual void ResetGpuRasterizationTracking() = 0; | 201 virtual void ResetGpuRasterizationTracking() = 0; |
| 202 |
| 203 protected: |
| 204 // Used to generate a unique identifier for a LayerTreeHost. |
| 205 static int GenerateHostId(); |
202 }; | 206 }; |
203 | 207 |
204 } // namespace cc | 208 } // namespace cc |
205 | 209 |
206 #endif // CC_TREES_LAYER_TREE_HOST_H_ | 210 #endif // CC_TREES_LAYER_TREE_HOST_H_ |
OLD | NEW |