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" |
11 #include "cc/debug/micro_benchmark.h" | 11 #include "cc/debug/micro_benchmark.h" |
12 #include "cc/input/browser_controls_state.h" | 12 #include "cc/input/browser_controls_state.h" |
| 13 #include "cc/surfaces/surface_reference_owner.h" |
13 | 14 |
14 namespace base { | 15 namespace base { |
15 class TimeTicks; | 16 class TimeTicks; |
16 } // namespace base | 17 } // namespace base |
17 | 18 |
18 namespace gfx { | 19 namespace gfx { |
19 class Rect; | 20 class Rect; |
20 } // namespace gfx | 21 } // namespace gfx |
21 | 22 |
22 namespace cc { | 23 namespace cc { |
23 class FrameSinkId; | 24 class FrameSinkId; |
24 class InputHandler; | 25 class InputHandler; |
25 class LayerTree; | 26 class LayerTree; |
26 class LayerTreeDebugState; | 27 class LayerTreeDebugState; |
27 class LayerTreeMutator; | 28 class LayerTreeMutator; |
28 class LayerTreeSettings; | 29 class LayerTreeSettings; |
29 class CompositorFrameSink; | 30 class CompositorFrameSink; |
30 class SurfaceSequenceGenerator; | |
31 class SwapPromise; | 31 class SwapPromise; |
32 class SwapPromiseManager; | 32 class SwapPromiseManager; |
33 class TaskRunnerProvider; | 33 class TaskRunnerProvider; |
34 class UIResourceManager; | 34 class UIResourceManager; |
35 | 35 |
36 // This encapsulates the API for any embedder to use cc. The | 36 // This encapsulates the API for any embedder to use cc. The |
37 // LayerTreeHostInProcess provides the implementation where the compositor | 37 // LayerTreeHostInProcess provides the implementation where the compositor |
38 // thread components of this host run within the same process. Use | 38 // thread components of this host run within the same process. Use |
39 // LayerTreeHostInProcess::CreateThreaded/CreateSingleThread to get either. | 39 // LayerTreeHostInProcess::CreateThreaded/CreateSingleThread to get either. |
40 class CC_EXPORT LayerTreeHost { | 40 class CC_EXPORT LayerTreeHost |
| 41 : public NON_EXPORTED_BASE(SurfaceReferenceOwner) { |
41 public: | 42 public: |
42 virtual ~LayerTreeHost() {} | 43 virtual ~LayerTreeHost() {} |
43 | 44 |
44 // Returns the process global unique identifier for this LayerTreeHost. | 45 // Returns the process global unique identifier for this LayerTreeHost. |
45 virtual int GetId() const = 0; | 46 virtual int GetId() const = 0; |
46 | 47 |
47 // The current source frame number. This is incremented for each main frame | 48 // The current source frame number. This is incremented for each main frame |
48 // update(commit) pushed to the compositor thread. | 49 // update(commit) pushed to the compositor thread. |
49 virtual int SourceFrameNumber() const = 0; | 50 virtual int SourceFrameNumber() const = 0; |
50 | 51 |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 virtual int ScheduleMicroBenchmark( | 181 virtual int ScheduleMicroBenchmark( |
181 const std::string& benchmark_name, | 182 const std::string& benchmark_name, |
182 std::unique_ptr<base::Value> value, | 183 std::unique_ptr<base::Value> value, |
183 const MicroBenchmark::DoneCallback& callback) = 0; | 184 const MicroBenchmark::DoneCallback& callback) = 0; |
184 | 185 |
185 // Returns true if the message was successfully delivered and handled. | 186 // Returns true if the message was successfully delivered and handled. |
186 virtual bool SendMessageToMicroBenchmark( | 187 virtual bool SendMessageToMicroBenchmark( |
187 int id, | 188 int id, |
188 std::unique_ptr<base::Value> value) = 0; | 189 std::unique_ptr<base::Value> value) = 0; |
189 | 190 |
190 // Methods used internally in cc. These are not intended to be a part of the | |
191 // public API for use by the embedder ---------------------- | |
192 virtual SurfaceSequenceGenerator* GetSurfaceSequenceGenerator() = 0; | |
193 | |
194 // When the main thread informs the impl thread that it is ready to commit, | 191 // When the main thread informs the impl thread that it is ready to commit, |
195 // generally it would remain blocked till the main thread state is copied to | 192 // generally it would remain blocked till the main thread state is copied to |
196 // the pending tree. Calling this would ensure that the main thread remains | 193 // the pending tree. Calling this would ensure that the main thread remains |
197 // blocked till the pending tree is activated. | 194 // blocked till the pending tree is activated. |
198 virtual void SetNextCommitWaitsForActivation() = 0; | 195 virtual void SetNextCommitWaitsForActivation() = 0; |
199 | 196 |
200 // The LayerTreeHost tracks whether the content is suitable for Gpu raster. | 197 // The LayerTreeHost tracks whether the content is suitable for Gpu raster. |
201 // Calling this will reset it back to not suitable state. | 198 // Calling this will reset it back to not suitable state. |
202 virtual void ResetGpuRasterizationTracking() = 0; | 199 virtual void ResetGpuRasterizationTracking() = 0; |
203 }; | 200 }; |
204 | 201 |
205 } // namespace cc | 202 } // namespace cc |
206 | 203 |
207 #endif // CC_TREES_LAYER_TREE_HOST_H_ | 204 #endif // CC_TREES_LAYER_TREE_HOST_H_ |
OLD | NEW |