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" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 63 |
64 // Sets the LayerTreeMutator interface used to directly mutate the compositor | 64 // Sets the LayerTreeMutator interface used to directly mutate the compositor |
65 // state on the compositor thread. (Compositor-Worker) | 65 // state on the compositor thread. (Compositor-Worker) |
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 // Returns the SwapPromiseManager used to create SwapPromiseMonitors for this |
| 74 // host. |
| 75 virtual SwapPromiseManager* GetSwapPromiseManager() const = 0; |
| 76 |
73 // Sets whether the content is suitable to use Gpu Rasterization. | 77 // Sets whether the content is suitable to use Gpu Rasterization. |
74 virtual void SetHasGpuRasterizationTrigger(bool has_trigger) = 0; | 78 virtual void SetHasGpuRasterizationTrigger(bool has_trigger) = 0; |
75 | 79 |
76 // Visibility and OutputSurface ------------------------------- | 80 // Visibility and OutputSurface ------------------------------- |
77 | 81 |
78 virtual void SetVisible(bool visible) = 0; | 82 virtual void SetVisible(bool visible) = 0; |
79 virtual bool IsVisible() const = 0; | 83 virtual bool IsVisible() const = 0; |
80 | 84 |
81 // Called in response to an OutputSurface request made to the client using | 85 // Called in response to an OutputSurface request made to the client using |
82 // LayerTreeHostClient::RequestNewOutputSurface. The client will be informed | 86 // LayerTreeHostClient::RequestNewOutputSurface. The client will be informed |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 std::unique_ptr<base::Value> value, | 174 std::unique_ptr<base::Value> value, |
171 const MicroBenchmark::DoneCallback& callback) = 0; | 175 const MicroBenchmark::DoneCallback& callback) = 0; |
172 | 176 |
173 // Returns true if the message was successfully delivered and handled. | 177 // Returns true if the message was successfully delivered and handled. |
174 virtual bool SendMessageToMicroBenchmark( | 178 virtual bool SendMessageToMicroBenchmark( |
175 int id, | 179 int id, |
176 std::unique_ptr<base::Value> value) = 0; | 180 std::unique_ptr<base::Value> value) = 0; |
177 | 181 |
178 // Methods used internally in cc. These are not intended to be a part of the | 182 // Methods used internally in cc. These are not intended to be a part of the |
179 // public API for use by the embedder ---------------------- | 183 // public API for use by the embedder ---------------------- |
180 | 184 virtual SurfaceSequenceGenerator* GetSurfaceSequenceGenerator() = 0; |
181 // When a SwapPromiseMonitor is created on the main thread, it calls | |
182 // InsertSwapPromiseMonitor() to register itself with LayerTreeHost. | |
183 // When the monitor is destroyed, it calls RemoveSwapPromiseMonitor() | |
184 // to unregister itself. | |
185 virtual void InsertSwapPromiseMonitor(SwapPromiseMonitor* monitor) = 0; | |
186 virtual void RemoveSwapPromiseMonitor(SwapPromiseMonitor* monitor) = 0; | |
187 }; | 185 }; |
188 | 186 |
189 } // namespace cc | 187 } // namespace cc |
190 | 188 |
191 #endif // CC_TREES_LAYER_TREE_HOST_INTERFACE_H_ | 189 #endif // CC_TREES_LAYER_TREE_HOST_INTERFACE_H_ |
OLD | NEW |