| 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 LayerTreeHostClient::RequestNewCompositorFrameSink. The client will |
| 83 // of the OutputSurface initialization status using DidInitializaOutputSurface | 83 // be informed of the CompositorFrameSink initialization status using |
| 84 // or DidFailToInitializeOutputSurface. The request is completed when the host | 84 // DidInitializaCompositorFrameSink or DidFailToInitializeCompositorFrameSink. |
| 85 // successfully initializes an OutputSurface. | 85 // The request is completed when the host successfully initializes an |
| 86 virtual void SetOutputSurface( | 86 // CompositorFrameSink. |
| 87 std::unique_ptr<OutputSurface> output_surface) = 0; | 87 virtual void SetCompositorFrameSink( |
| 88 std::unique_ptr<CompositorFrameSink> compositor_frame_sink) = 0; |
| 88 | 89 |
| 89 // Forces the host to immediately release all references to the OutputSurface, | 90 // Forces the host to immediately release all references to the |
| 90 // if any. Can be safely called any time. | 91 // CompositorFrameSink, if any. Can be safely called any time. |
| 91 virtual std::unique_ptr<OutputSurface> ReleaseOutputSurface() = 0; | 92 virtual std::unique_ptr<CompositorFrameSink> ReleaseCompositorFrameSink() = 0; |
| 92 | 93 |
| 93 // Frame Scheduling (main and compositor frames) requests ------- | 94 // Frame Scheduling (main and compositor frames) requests ------- |
| 94 | 95 |
| 95 // Requests a main frame update even if no content has changed. This is used, | 96 // 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 | 97 // 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 | 98 // main frame update is run on the next tick without pre-emptively forcing a |
| 98 // full commit synchronization or layer updates. | 99 // full commit synchronization or layer updates. |
| 99 virtual void SetNeedsAnimate() = 0; | 100 virtual void SetNeedsAnimate() = 0; |
| 100 | 101 |
| 101 // Requests a main frame update and also ensure that the host pulls layer | 102 // 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. | 183 // InsertSwapPromiseMonitor() to register itself with LayerTreeHost. |
| 183 // When the monitor is destroyed, it calls RemoveSwapPromiseMonitor() | 184 // When the monitor is destroyed, it calls RemoveSwapPromiseMonitor() |
| 184 // to unregister itself. | 185 // to unregister itself. |
| 185 virtual void InsertSwapPromiseMonitor(SwapPromiseMonitor* monitor) = 0; | 186 virtual void InsertSwapPromiseMonitor(SwapPromiseMonitor* monitor) = 0; |
| 186 virtual void RemoveSwapPromiseMonitor(SwapPromiseMonitor* monitor) = 0; | 187 virtual void RemoveSwapPromiseMonitor(SwapPromiseMonitor* monitor) = 0; |
| 187 }; | 188 }; |
| 188 | 189 |
| 189 } // namespace cc | 190 } // namespace cc |
| 190 | 191 |
| 191 #endif // CC_TREES_LAYER_TREE_HOST_INTERFACE_H_ | 192 #endif // CC_TREES_LAYER_TREE_HOST_INTERFACE_H_ |
| OLD | NEW |