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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 void OnVSyncParametersChanged(base::TimeTicks timebase, | 152 void OnVSyncParametersChanged(base::TimeTicks timebase, |
153 base::TimeDelta interval); | 153 base::TimeDelta interval); |
154 virtual void FrameRateControllerTick(bool throttled, | 154 virtual void FrameRateControllerTick(bool throttled, |
155 const BeginFrameArgs& args) OVERRIDE; | 155 const BeginFrameArgs& args) OVERRIDE; |
156 scoped_ptr<FrameRateController> frame_rate_controller_; | 156 scoped_ptr<FrameRateController> frame_rate_controller_; |
157 int max_frames_pending_; | 157 int max_frames_pending_; |
158 int pending_swap_buffers_; | 158 int pending_swap_buffers_; |
159 bool needs_begin_frame_; | 159 bool needs_begin_frame_; |
160 bool begin_frame_pending_; | 160 bool begin_frame_pending_; |
161 | 161 |
| 162 // This stores a BeginFrame that we couldn't process immediately, but might |
| 163 // process retroactively in the near future. |
| 164 BeginFrameArgs skipped_begin_frame_args_; |
| 165 |
162 // Forwarded to OutputSurfaceClient but threaded through OutputSurface | 166 // Forwarded to OutputSurfaceClient but threaded through OutputSurface |
163 // first so OutputSurface has a chance to update the FrameRateController | 167 // first so OutputSurface has a chance to update the FrameRateController |
164 void SetNeedsRedrawRect(gfx::Rect damage_rect); | 168 void SetNeedsRedrawRect(gfx::Rect damage_rect); |
165 void BeginFrame(const BeginFrameArgs& args); | 169 void BeginFrame(const BeginFrameArgs& args); |
166 void DidSwapBuffers(); | 170 void DidSwapBuffers(); |
167 void OnSwapBuffersComplete(const CompositorFrameAck* ack); | 171 void OnSwapBuffersComplete(const CompositorFrameAck* ack); |
168 void DidLoseOutputSurface(); | 172 void DidLoseOutputSurface(); |
169 void SetExternalStencilTest(bool enabled); | 173 void SetExternalStencilTest(bool enabled); |
170 void SetExternalDrawConstraints(const gfx::Transform& transform, | 174 void SetExternalDrawConstraints(const gfx::Transform& transform, |
171 gfx::Rect viewport, | 175 gfx::Rect viewport, |
172 gfx::Rect clip, | 176 gfx::Rect clip, |
173 bool valid_for_tile_management); | 177 bool valid_for_tile_management); |
174 | 178 |
175 // virtual for testing. | 179 // virtual for testing. |
176 virtual base::TimeDelta AlternateRetroactiveBeginFramePeriod(); | 180 virtual base::TimeTicks RetroactiveBeginFrameDeadline(); |
177 virtual void PostCheckForRetroactiveBeginFrame(); | 181 virtual void PostCheckForRetroactiveBeginFrame(); |
178 void CheckForRetroactiveBeginFrame(); | 182 void CheckForRetroactiveBeginFrame(); |
179 | 183 |
180 private: | 184 private: |
181 OutputSurfaceClient* client_; | 185 OutputSurfaceClient* client_; |
182 friend class OutputSurfaceCallbacks; | 186 friend class OutputSurfaceCallbacks; |
183 | 187 |
184 void SetUpContext3d(); | 188 void SetUpContext3d(); |
185 void ResetContext3d(); | 189 void ResetContext3d(); |
186 void SetMemoryPolicy(const ManagedMemoryPolicy& policy, | 190 void SetMemoryPolicy(const ManagedMemoryPolicy& policy, |
187 bool discard_backbuffer_when_not_visible); | 191 bool discard_backbuffer_when_not_visible); |
188 | 192 |
189 // This stores a BeginFrame that we couldn't process immediately, but might | |
190 // process retroactively in the near future. | |
191 BeginFrameArgs skipped_begin_frame_args_; | |
192 | |
193 // check_for_retroactive_begin_frame_pending_ is used to avoid posting | 193 // check_for_retroactive_begin_frame_pending_ is used to avoid posting |
194 // redundant checks for a retroactive BeginFrame. | 194 // redundant checks for a retroactive BeginFrame. |
195 bool check_for_retroactive_begin_frame_pending_; | 195 bool check_for_retroactive_begin_frame_pending_; |
196 | 196 |
197 DISALLOW_COPY_AND_ASSIGN(OutputSurface); | 197 DISALLOW_COPY_AND_ASSIGN(OutputSurface); |
198 }; | 198 }; |
199 | 199 |
200 } // namespace cc | 200 } // namespace cc |
201 | 201 |
202 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ | 202 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ |
OLD | NEW |