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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 // Returns the SwapPromiseManager used to create SwapPromiseMonitors for this | 73 // Returns the SwapPromiseManager used to create SwapPromiseMonitors for this |
74 // host. | 74 // host. |
75 virtual SwapPromiseManager* GetSwapPromiseManager() = 0; | 75 virtual SwapPromiseManager* GetSwapPromiseManager() = 0; |
76 | 76 |
77 // Sets whether the content is suitable to use Gpu Rasterization. | 77 // Sets whether the content is suitable to use Gpu Rasterization. |
78 virtual void SetHasGpuRasterizationTrigger(bool has_trigger) = 0; | 78 virtual void SetHasGpuRasterizationTrigger(bool has_trigger) = 0; |
79 | 79 |
80 // Visibility and OutputSurface ------------------------------- | 80 // Visibility and CompositorFrameSink ------------------------------- |
81 | 81 |
82 virtual void SetVisible(bool visible) = 0; | 82 virtual void SetVisible(bool visible) = 0; |
83 virtual bool IsVisible() const = 0; | 83 virtual bool IsVisible() const = 0; |
84 | 84 |
85 // Called in response to an OutputSurface request made to the client using | 85 // Called in response to an CompositorFrameSink request made to the client |
86 // LayerTreeHostClient::RequestNewOutputSurface. The client will be informed | 86 // using LayerTreeHostClient::RequestNewCompositorFrameSink. The client will |
87 // of the OutputSurface initialization status using DidInitializaOutputSurface | 87 // be informed of the CompositorFrameSink initialization status using |
88 // or DidFailToInitializeOutputSurface. The request is completed when the host | 88 // DidInitializaCompositorFrameSink or DidFailToInitializeCompositorFrameSink. |
89 // successfully initializes an OutputSurface. | 89 // The request is completed when the host successfully initializes an |
90 virtual void SetOutputSurface( | 90 // CompositorFrameSink. |
91 std::unique_ptr<OutputSurface> output_surface) = 0; | 91 virtual void SetCompositorFrameSink( |
| 92 std::unique_ptr<CompositorFrameSink> compositor_frame_sink) = 0; |
92 | 93 |
93 // Forces the host to immediately release all references to the OutputSurface, | 94 // Forces the host to immediately release all references to the |
94 // if any. Can be safely called any time. | 95 // CompositorFrameSink, if any. Can be safely called any time. |
95 virtual std::unique_ptr<OutputSurface> ReleaseOutputSurface() = 0; | 96 virtual std::unique_ptr<CompositorFrameSink> ReleaseCompositorFrameSink() = 0; |
96 | 97 |
97 // Frame Scheduling (main and compositor frames) requests ------- | 98 // Frame Scheduling (main and compositor frames) requests ------- |
98 | 99 |
99 // 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, |
100 // 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 |
101 // 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 |
102 // full commit synchronization or layer updates. | 103 // full commit synchronization or layer updates. |
103 virtual void SetNeedsAnimate() = 0; | 104 virtual void SetNeedsAnimate() = 0; |
104 | 105 |
105 // 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 std::unique_ptr<base::Value> value) = 0; | 181 std::unique_ptr<base::Value> value) = 0; |
181 | 182 |
182 // Methods used internally in cc. These are not intended to be a part of the | 183 // Methods used internally in cc. These are not intended to be a part of the |
183 // public API for use by the embedder ---------------------- | 184 // public API for use by the embedder ---------------------- |
184 virtual SurfaceSequenceGenerator* GetSurfaceSequenceGenerator() = 0; | 185 virtual SurfaceSequenceGenerator* GetSurfaceSequenceGenerator() = 0; |
185 }; | 186 }; |
186 | 187 |
187 } // namespace cc | 188 } // namespace cc |
188 | 189 |
189 #endif // CC_TREES_LAYER_TREE_HOST_INTERFACE_H_ | 190 #endif // CC_TREES_LAYER_TREE_HOST_INTERFACE_H_ |
OLD | NEW |