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_OUTPUT_SURFACE_H_ | 5 #ifndef CC_OUTPUT_OUTPUT_SURFACE_H_ |
6 #define CC_OUTPUT_OUTPUT_SURFACE_H_ | 6 #define CC_OUTPUT_OUTPUT_SURFACE_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 virtual void EnsureBackbuffer(); | 106 virtual void EnsureBackbuffer(); |
107 virtual void DiscardBackbuffer(); | 107 virtual void DiscardBackbuffer(); |
108 | 108 |
109 virtual void Reshape(const gfx::Size& size, float scale_factor); | 109 virtual void Reshape(const gfx::Size& size, float scale_factor); |
110 virtual gfx::Size SurfaceSize() const; | 110 virtual gfx::Size SurfaceSize() const; |
111 | 111 |
112 virtual void BindFramebuffer(); | 112 virtual void BindFramebuffer(); |
113 | 113 |
114 // The implementation may destroy or steal the contents of the CompositorFrame | 114 // The implementation may destroy or steal the contents of the CompositorFrame |
115 // passed in (though it will not take ownership of the CompositorFrame | 115 // passed in (though it will not take ownership of the CompositorFrame |
116 // itself). | 116 // itself). For successful swaps, the implementation must call |
117 virtual void SwapBuffers(CompositorFrame* frame); | 117 // OutputSurfaceClient::DidSwapBuffers() and eventually |
| 118 // DidSwapBuffersComplete(). |
| 119 virtual void SwapBuffers(CompositorFrame* frame) = 0; |
118 virtual void OnSwapBuffersComplete(); | 120 virtual void OnSwapBuffersComplete(); |
119 | 121 |
120 // Notifies frame-rate smoothness preference. If true, all non-critical | 122 // Notifies frame-rate smoothness preference. If true, all non-critical |
121 // processing should be stopped, or lowered in priority. | 123 // processing should be stopped, or lowered in priority. |
122 virtual void UpdateSmoothnessTakesPriority(bool prefer_smoothness) {} | 124 virtual void UpdateSmoothnessTakesPriority(bool prefer_smoothness) {} |
123 | 125 |
124 // Requests a BeginFrame notification from the output surface. The | 126 // Requests a BeginFrame notification from the output surface. The |
125 // notification will be delivered by calling | 127 // notification will be delivered by calling |
126 // OutputSurfaceClient::BeginFrame until the callback is disabled. | 128 // OutputSurfaceClient::BeginFrame until the callback is disabled. |
127 virtual void SetNeedsBeginFrame(bool enable) {} | 129 virtual void SetNeedsBeginFrame(bool enable) {} |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 bool external_stencil_test_enabled_; | 177 bool external_stencil_test_enabled_; |
176 | 178 |
177 base::WeakPtrFactory<OutputSurface> weak_ptr_factory_; | 179 base::WeakPtrFactory<OutputSurface> weak_ptr_factory_; |
178 | 180 |
179 DISALLOW_COPY_AND_ASSIGN(OutputSurface); | 181 DISALLOW_COPY_AND_ASSIGN(OutputSurface); |
180 }; | 182 }; |
181 | 183 |
182 } // namespace cc | 184 } // namespace cc |
183 | 185 |
184 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ | 186 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ |
OLD | NEW |