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 "gpu/command_buffer/common/texture_in_use_response.h" | 19 #include "gpu/command_buffer/common/texture_in_use_response.h" |
20 #include "ui/gfx/color_space.h" | 20 #include "ui/gfx/color_space.h" |
21 | 21 |
22 namespace gpu { | 22 namespace gpu { |
23 class GpuMemoryBufferManager; | 23 class GpuMemoryBufferManager; |
24 } | 24 } |
25 | 25 |
26 namespace cc { | 26 namespace cc { |
27 | 27 |
| 28 struct BeginFrameAck; |
28 class CompositorFrame; | 29 class CompositorFrame; |
29 class CompositorFrameSinkClient; | 30 class CompositorFrameSinkClient; |
30 class LocalSurfaceId; | 31 class LocalSurfaceId; |
31 class SharedBitmapManager; | 32 class SharedBitmapManager; |
32 | 33 |
33 // An interface for submitting CompositorFrames to a display compositor | 34 // An interface for submitting CompositorFrames to a display compositor |
34 // which will compose frames from multiple CompositorFrameSinks to show | 35 // which will compose frames from multiple CompositorFrameSinks to show |
35 // on screen to the user. | 36 // on screen to the user. |
36 // If a context_provider() is present, frames should be submitted with | 37 // If a context_provider() is present, frames should be submitted with |
37 // OpenGL resources (created with the context_provider()). If not, then | 38 // OpenGL resources (created with the context_provider()). If not, then |
(...skipping 76 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 // Signals that a BeginFrame issued by the BeginFrameSource provided to the |
| 126 // client did not lead to a CompositorFrame submission. |
| 127 virtual void DidNotProduceFrame(const BeginFrameAck& ack) = 0; |
| 128 |
124 protected: | 129 protected: |
125 // Bound to the ContextProvider to hear about when it is lost and inform the | 130 // Bound to the ContextProvider to hear about when it is lost and inform the |
126 // |client_|. | 131 // |client_|. |
127 void DidLoseCompositorFrameSink(); | 132 void DidLoseCompositorFrameSink(); |
128 | 133 |
129 CompositorFrameSinkClient* client_ = nullptr; | 134 CompositorFrameSinkClient* client_ = nullptr; |
130 | 135 |
131 struct CompositorFrameSink::Capabilities capabilities_; | 136 struct CompositorFrameSink::Capabilities capabilities_; |
132 scoped_refptr<ContextProvider> context_provider_; | 137 scoped_refptr<ContextProvider> context_provider_; |
133 scoped_refptr<ContextProvider> worker_context_provider_; | 138 scoped_refptr<ContextProvider> worker_context_provider_; |
134 scoped_refptr<VulkanContextProvider> vulkan_context_provider_; | 139 scoped_refptr<VulkanContextProvider> vulkan_context_provider_; |
135 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; | 140 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; |
136 SharedBitmapManager* shared_bitmap_manager_; | 141 SharedBitmapManager* shared_bitmap_manager_; |
137 | 142 |
138 private: | 143 private: |
139 DISALLOW_COPY_AND_ASSIGN(CompositorFrameSink); | 144 DISALLOW_COPY_AND_ASSIGN(CompositorFrameSink); |
140 }; | 145 }; |
141 | 146 |
142 } // namespace cc | 147 } // namespace cc |
143 | 148 |
144 #endif // CC_OUTPUT_COMPOSITOR_FRAME_SINK_H_ | 149 #endif // CC_OUTPUT_COMPOSITOR_FRAME_SINK_H_ |
OLD | NEW |