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 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 // If supported, this causes a ReclaimResources for all resources that are | 97 // If supported, this causes a ReclaimResources for all resources that are |
98 // currently in use. | 98 // currently in use. |
99 virtual void ForceReclaimResources() {} | 99 virtual void ForceReclaimResources() {} |
100 | 100 |
101 // Support for a pull-model where draws are requested by the output surface. | 101 // Support for a pull-model where draws are requested by the output surface. |
102 // | 102 // |
103 // CompositorFrameSink::Invalidate is called by the compositor to notify that | 103 // CompositorFrameSink::Invalidate is called by the compositor to notify that |
104 // there's new content. | 104 // there's new content. |
105 virtual void Invalidate() {} | 105 virtual void Invalidate() {} |
106 | 106 |
107 // For successful swaps, the implementation must call DidSwapBuffersComplete() | 107 // For successful swaps, the implementation must call |
108 // (via OnSwapBuffersComplete()) eventually. | 108 // DidReceiveCompositorFrameAck() asynchronously when the frame has been |
109 virtual void SwapBuffers(CompositorFrame frame) = 0; | 109 // processed in order to unthrottle the next frame. |
110 virtual void OnSwapBuffersComplete(); | 110 virtual void SubmitCompositorFrame(CompositorFrame frame) = 0; |
111 | 111 |
112 protected: | 112 protected: |
113 // Bound to the ContextProvider to hear about when it is lost and inform the | 113 // Bound to the ContextProvider to hear about when it is lost and inform the |
114 // |client_|. | 114 // |client_|. |
115 void DidLoseCompositorFrameSink(); | 115 void DidLoseCompositorFrameSink(); |
116 | 116 |
117 CompositorFrameSinkClient* client_ = nullptr; | 117 CompositorFrameSinkClient* client_ = nullptr; |
118 | 118 |
119 struct CompositorFrameSink::Capabilities capabilities_; | 119 struct CompositorFrameSink::Capabilities capabilities_; |
120 scoped_refptr<ContextProvider> context_provider_; | 120 scoped_refptr<ContextProvider> context_provider_; |
121 scoped_refptr<ContextProvider> worker_context_provider_; | 121 scoped_refptr<ContextProvider> worker_context_provider_; |
122 scoped_refptr<VulkanContextProvider> vulkan_context_provider_; | 122 scoped_refptr<VulkanContextProvider> vulkan_context_provider_; |
123 base::ThreadChecker client_thread_checker_; | 123 base::ThreadChecker client_thread_checker_; |
124 | 124 |
125 private: | 125 private: |
126 DISALLOW_COPY_AND_ASSIGN(CompositorFrameSink); | 126 DISALLOW_COPY_AND_ASSIGN(CompositorFrameSink); |
127 }; | 127 }; |
128 | 128 |
129 } // namespace cc | 129 } // namespace cc |
130 | 130 |
131 #endif // CC_OUTPUT_COMPOSITOR_FRAME_SINK_H_ | 131 #endif // CC_OUTPUT_COMPOSITOR_FRAME_SINK_H_ |
OLD | NEW |