OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_OUTPUT_COMPOSITOR_FRAME_SINK_H_ | 5 #ifndef CC_OUTPUT_COMPOSITOR_FRAME_SINK_H_ |
6 #define CC_OUTPUT_COMPOSITOR_FRAME_SINK_H_ | 6 #define CC_OUTPUT_COMPOSITOR_FRAME_SINK_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/threading/thread_checker.h" | 13 #include "base/threading/thread_checker.h" |
14 #include "cc/cc_export.h" | 14 #include "cc/cc_export.h" |
15 #include "cc/output/context_provider.h" | 15 #include "cc/output/context_provider.h" |
16 #include "cc/output/overlay_candidate_validator.h" | 16 #include "cc/output/overlay_candidate_validator.h" |
17 #include "cc/output/vulkan_context_provider.h" | 17 #include "cc/output/vulkan_context_provider.h" |
18 #include "cc/resources/returned_resource.h" | 18 #include "cc/resources/returned_resource.h" |
19 #include "cc/surfaces/surface_id.h" | |
19 #include "gpu/command_buffer/common/texture_in_use_response.h" | 20 #include "gpu/command_buffer/common/texture_in_use_response.h" |
20 #include "ui/gfx/color_space.h" | 21 #include "ui/gfx/color_space.h" |
21 | 22 |
22 namespace gpu { | 23 namespace gpu { |
23 class GpuMemoryBufferManager; | 24 class GpuMemoryBufferManager; |
24 } | 25 } |
25 | 26 |
26 namespace cc { | 27 namespace cc { |
27 | 28 |
28 class CompositorFrame; | 29 class CompositorFrame; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
114 // | 115 // |
115 // CompositorFrameSink::Invalidate is called by the compositor to notify that | 116 // CompositorFrameSink::Invalidate is called by the compositor to notify that |
116 // there's new content. | 117 // there's new content. |
117 virtual void Invalidate() {} | 118 virtual void Invalidate() {} |
118 | 119 |
119 // For successful swaps, the implementation must call | 120 // For successful swaps, the implementation must call |
120 // DidReceiveCompositorFrameAck() asynchronously when the frame has been | 121 // DidReceiveCompositorFrameAck() asynchronously when the frame has been |
121 // processed in order to unthrottle the next frame. | 122 // processed in order to unthrottle the next frame. |
122 virtual void SubmitCompositorFrame(CompositorFrame frame) = 0; | 123 virtual void SubmitCompositorFrame(CompositorFrame frame) = 0; |
123 | 124 |
125 // Notify that the surface is no longer in use (and is okay to be evicted) so | |
126 // that its resources gets returned in time. | |
127 virtual void EvictFrame() {} | |
Fady Samuel
2017/05/08 15:52:09
Is this necessary? Can we avoid adding this?
Peng
2017/05/08 17:44:39
The exo need call this function to flush frames be
Fady Samuel
2017/05/08 18:17:35
OK Thanks.
| |
128 | |
129 // Get the current surface id. | |
130 virtual SurfaceId GetSurfaceId() const; | |
Fady Samuel
2017/05/08 15:52:09
Is this necessary, can we avoid adding this?
Peng
2017/05/08 17:44:39
Done
| |
131 | |
124 protected: | 132 protected: |
125 // Bound to the ContextProvider to hear about when it is lost and inform the | 133 // Bound to the ContextProvider to hear about when it is lost and inform the |
126 // |client_|. | 134 // |client_|. |
127 void DidLoseCompositorFrameSink(); | 135 void DidLoseCompositorFrameSink(); |
128 | 136 |
129 CompositorFrameSinkClient* client_ = nullptr; | 137 CompositorFrameSinkClient* client_ = nullptr; |
130 | 138 |
131 struct CompositorFrameSink::Capabilities capabilities_; | 139 struct CompositorFrameSink::Capabilities capabilities_; |
132 scoped_refptr<ContextProvider> context_provider_; | 140 scoped_refptr<ContextProvider> context_provider_; |
133 scoped_refptr<ContextProvider> worker_context_provider_; | 141 scoped_refptr<ContextProvider> worker_context_provider_; |
134 scoped_refptr<VulkanContextProvider> vulkan_context_provider_; | 142 scoped_refptr<VulkanContextProvider> vulkan_context_provider_; |
135 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; | 143 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; |
136 SharedBitmapManager* shared_bitmap_manager_; | 144 SharedBitmapManager* shared_bitmap_manager_; |
137 | 145 |
138 private: | 146 private: |
139 DISALLOW_COPY_AND_ASSIGN(CompositorFrameSink); | 147 DISALLOW_COPY_AND_ASSIGN(CompositorFrameSink); |
140 }; | 148 }; |
141 | 149 |
142 } // namespace cc | 150 } // namespace cc |
143 | 151 |
144 #endif // CC_OUTPUT_COMPOSITOR_FRAME_SINK_H_ | 152 #endif // CC_OUTPUT_COMPOSITOR_FRAME_SINK_H_ |
OLD | NEW |