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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 | 118 |
119 virtual void Reshape(const gfx::Size& size, float scale_factor); | 119 virtual void Reshape(const gfx::Size& size, float scale_factor); |
120 virtual gfx::Size SurfaceSize() const; | 120 virtual gfx::Size SurfaceSize() const; |
121 | 121 |
122 virtual void BindFramebuffer(); | 122 virtual void BindFramebuffer(); |
123 | 123 |
124 // The implementation may destroy or steal the contents of the CompositorFrame | 124 // The implementation may destroy or steal the contents of the CompositorFrame |
125 // passed in (though it will not take ownership of the CompositorFrame | 125 // passed in (though it will not take ownership of the CompositorFrame |
126 // itself). | 126 // itself). |
127 virtual void SwapBuffers(CompositorFrame* frame); | 127 virtual void SwapBuffers(CompositorFrame* frame); |
| 128 virtual void OnSwapBuffersComplete(); |
128 | 129 |
129 // Notifies frame-rate smoothness preference. If true, all non-critical | 130 // Notifies frame-rate smoothness preference. If true, all non-critical |
130 // processing should be stopped, or lowered in priority. | 131 // processing should be stopped, or lowered in priority. |
131 virtual void UpdateSmoothnessTakesPriority(bool prefer_smoothness) {} | 132 virtual void UpdateSmoothnessTakesPriority(bool prefer_smoothness) {} |
132 | 133 |
133 // Requests a BeginFrame notification from the output surface. The | 134 // Requests a BeginFrame notification from the output surface. The |
134 // notification will be delivered by calling | 135 // notification will be delivered by calling |
135 // OutputSurfaceClient::BeginFrame until the callback is disabled. | 136 // OutputSurfaceClient::BeginFrame until the callback is disabled. |
136 virtual void SetNeedsBeginFrame(bool enable) {} | 137 virtual void SetNeedsBeginFrame(bool enable) {} |
137 | 138 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 const gfx::Rect& viewport, | 176 const gfx::Rect& viewport, |
176 const gfx::Rect& clip, | 177 const gfx::Rect& clip, |
177 bool valid_for_tile_management); | 178 bool valid_for_tile_management); |
178 | 179 |
179 private: | 180 private: |
180 void SetUpContext3d(); | 181 void SetUpContext3d(); |
181 void ResetContext3d(); | 182 void ResetContext3d(); |
182 void SetMemoryPolicy(const ManagedMemoryPolicy& policy); | 183 void SetMemoryPolicy(const ManagedMemoryPolicy& policy); |
183 void UpdateAndMeasureGpuLatency(); | 184 void UpdateAndMeasureGpuLatency(); |
184 | 185 |
185 void OnSwapBuffersComplete(); | 186 void DoOnSwapBuffersComplete(); |
186 | 187 |
187 bool external_stencil_test_enabled_; | 188 bool external_stencil_test_enabled_; |
188 | 189 |
189 base::WeakPtrFactory<OutputSurface> weak_ptr_factory_; | 190 base::WeakPtrFactory<OutputSurface> weak_ptr_factory_; |
190 | 191 |
191 std::deque<unsigned> available_gpu_latency_query_ids_; | 192 std::deque<unsigned> available_gpu_latency_query_ids_; |
192 std::deque<unsigned> pending_gpu_latency_query_ids_; | 193 std::deque<unsigned> pending_gpu_latency_query_ids_; |
193 RollingTimeDeltaHistory gpu_latency_history_; | 194 RollingTimeDeltaHistory gpu_latency_history_; |
194 | 195 |
195 DISALLOW_COPY_AND_ASSIGN(OutputSurface); | 196 DISALLOW_COPY_AND_ASSIGN(OutputSurface); |
196 }; | 197 }; |
197 | 198 |
198 } // namespace cc | 199 } // namespace cc |
199 | 200 |
200 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ | 201 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ |
OLD | NEW |