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_INTERFACE_H_ | 5 #ifndef CC_TREES_LAYER_TREE_HOST_INTERFACE_H_ |
6 #define CC_TREES_LAYER_TREE_HOST_INTERFACE_H_ | 6 #define CC_TREES_LAYER_TREE_HOST_INTERFACE_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "cc/base/cc_export.h" | 9 #include "cc/base/cc_export.h" |
10 #include "cc/debug/micro_benchmark.h" | 10 #include "cc/debug/micro_benchmark.h" |
11 #include "cc/input/top_controls_state.h" | 11 #include "cc/input/top_controls_state.h" |
12 | 12 |
13 namespace base { | 13 namespace base { |
14 class TimeTicks; | 14 class TimeTicks; |
15 } // namespace base | 15 } // namespace base |
16 | 16 |
17 namespace gfx { | 17 namespace gfx { |
18 class Rect; | 18 class Rect; |
19 } // namespace gfx | 19 } // namespace gfx |
20 | 20 |
21 namespace cc { | 21 namespace cc { |
22 class InputHandler; | 22 class InputHandler; |
23 class LayerTree; | 23 class LayerTree; |
24 class LayerTreeDebugState; | 24 class LayerTreeDebugState; |
25 class LayerTreeMutator; | 25 class LayerTreeMutator; |
26 class LayerTreeSettings; | 26 class LayerTreeSettings; |
27 class OutputSurface; | 27 class CompositorFrameSink; |
28 class SwapPromiseMonitor; | 28 class SwapPromiseMonitor; |
29 class TaskRunnerProvider; | 29 class TaskRunnerProvider; |
30 class UIResourceManager; | 30 class UIResourceManager; |
31 | 31 |
32 // TODO(khushalsagar): Will be renamed to LayerTreeHost. | 32 // TODO(khushalsagar): Will be renamed to LayerTreeHost. |
33 class CC_EXPORT LayerTreeHostInterface { | 33 class CC_EXPORT LayerTreeHostInterface { |
34 public: | 34 public: |
35 virtual ~LayerTreeHostInterface() {} | 35 virtual ~LayerTreeHostInterface() {} |
36 | 36 |
37 // Returns the process global unique identifier for this LayerTreeHost. | 37 // Returns the process global unique identifier for this LayerTreeHost. |
(...skipping 28 matching lines...) Expand all Loading... | |
66 virtual void SetLayerTreeMutator( | 66 virtual void SetLayerTreeMutator( |
67 std::unique_ptr<LayerTreeMutator> mutator) = 0; | 67 std::unique_ptr<LayerTreeMutator> mutator) = 0; |
68 | 68 |
69 // Call this function when you expect there to be a swap buffer. | 69 // Call this function when you expect there to be a swap buffer. |
70 // See swap_promise.h for how to use SwapPromise. | 70 // See swap_promise.h for how to use SwapPromise. |
71 virtual void QueueSwapPromise(std::unique_ptr<SwapPromise> swap_promise) = 0; | 71 virtual void QueueSwapPromise(std::unique_ptr<SwapPromise> swap_promise) = 0; |
72 | 72 |
73 // Sets whether the content is suitable to use Gpu Rasterization. | 73 // Sets whether the content is suitable to use Gpu Rasterization. |
74 virtual void SetHasGpuRasterizationTrigger(bool has_trigger) = 0; | 74 virtual void SetHasGpuRasterizationTrigger(bool has_trigger) = 0; |
75 | 75 |
76 // Visibility and OutputSurface ------------------------------- | 76 // Visibility and CompositorFrameSink ------------------------------- |
77 | 77 |
78 virtual void SetVisible(bool visible) = 0; | 78 virtual void SetVisible(bool visible) = 0; |
79 virtual bool IsVisible() const = 0; | 79 virtual bool IsVisible() const = 0; |
80 | 80 |
81 // Called in response to an OutputSurface request made to the client using | 81 // Called in response to an CompositorFrameSink request made to the client |
82 // LayerTreeHostClient::RequestNewOutputSurface. The client will be informed | 82 // using |
enne (OOO)
2016/09/14 00:35:45
@_@
| |
83 // of the OutputSurface initialization status using DidInitializaOutputSurface | 83 // LayerTreeHostClient::RequestNewCompositorFrameSink. The client will be |
84 // or DidFailToInitializeOutputSurface. The request is completed when the host | 84 // informed |
85 // successfully initializes an OutputSurface. | 85 // of the CompositorFrameSink initialization status using |
86 virtual void SetOutputSurface( | 86 // DidInitializaCompositorFrameSink |
87 std::unique_ptr<OutputSurface> output_surface) = 0; | 87 // or DidFailToInitializeCompositorFrameSink. The request is completed when |
88 // the host | |
89 // successfully initializes an CompositorFrameSink. | |
90 virtual void SetCompositorFrameSink( | |
91 std::unique_ptr<CompositorFrameSink> compositor_frame_sink) = 0; | |
88 | 92 |
89 // Forces the host to immediately release all references to the OutputSurface, | 93 // Forces the host to immediately release all references to the |
94 // CompositorFrameSink, | |
enne (OOO)
2016/09/14 00:35:45
@_@
| |
90 // if any. Can be safely called any time. | 95 // if any. Can be safely called any time. |
91 virtual std::unique_ptr<OutputSurface> ReleaseOutputSurface() = 0; | 96 virtual std::unique_ptr<CompositorFrameSink> ReleaseCompositorFrameSink() = 0; |
92 | 97 |
93 // Frame Scheduling (main and compositor frames) requests ------- | 98 // Frame Scheduling (main and compositor frames) requests ------- |
94 | 99 |
95 // Requests a main frame update even if no content has changed. This is used, | 100 // Requests a main frame update even if no content has changed. This is used, |
96 // for instance in the case of RequestAnimationFrame from blink to ensure the | 101 // for instance in the case of RequestAnimationFrame from blink to ensure the |
97 // main frame update is run on the next tick without pre-emptively forcing a | 102 // main frame update is run on the next tick without pre-emptively forcing a |
98 // full commit synchronization or layer updates. | 103 // full commit synchronization or layer updates. |
99 virtual void SetNeedsAnimate() = 0; | 104 virtual void SetNeedsAnimate() = 0; |
100 | 105 |
101 // Requests a main frame update and also ensure that the host pulls layer | 106 // Requests a main frame update and also ensure that the host pulls layer |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
182 // InsertSwapPromiseMonitor() to register itself with LayerTreeHost. | 187 // InsertSwapPromiseMonitor() to register itself with LayerTreeHost. |
183 // When the monitor is destroyed, it calls RemoveSwapPromiseMonitor() | 188 // When the monitor is destroyed, it calls RemoveSwapPromiseMonitor() |
184 // to unregister itself. | 189 // to unregister itself. |
185 virtual void InsertSwapPromiseMonitor(SwapPromiseMonitor* monitor) = 0; | 190 virtual void InsertSwapPromiseMonitor(SwapPromiseMonitor* monitor) = 0; |
186 virtual void RemoveSwapPromiseMonitor(SwapPromiseMonitor* monitor) = 0; | 191 virtual void RemoveSwapPromiseMonitor(SwapPromiseMonitor* monitor) = 0; |
187 }; | 192 }; |
188 | 193 |
189 } // namespace cc | 194 } // namespace cc |
190 | 195 |
191 #endif // CC_TREES_LAYER_TREE_HOST_INTERFACE_H_ | 196 #endif // CC_TREES_LAYER_TREE_HOST_INTERFACE_H_ |
OLD | NEW |