| 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 | 176 |
| 173 // virtual for testing. | 177 // virtual for testing. |
| 174 virtual base::TimeDelta AlternateRetroactiveBeginFramePeriod(); | 178 virtual base::TimeTicks RetroactiveBeginFrameDeadline(); |
| 175 virtual void PostCheckForRetroactiveBeginFrame(); | 179 virtual void PostCheckForRetroactiveBeginFrame(); |
| 176 void CheckForRetroactiveBeginFrame(); | 180 void CheckForRetroactiveBeginFrame(); |
| 177 | 181 |
| 178 private: | 182 private: |
| 179 OutputSurfaceClient* client_; | 183 OutputSurfaceClient* client_; |
| 180 friend class OutputSurfaceCallbacks; | 184 friend class OutputSurfaceCallbacks; |
| 181 | 185 |
| 182 void SetUpContext3d(); | 186 void SetUpContext3d(); |
| 183 void ResetContext3d(); | 187 void ResetContext3d(); |
| 184 void SetMemoryPolicy(const ManagedMemoryPolicy& policy, | 188 void SetMemoryPolicy(const ManagedMemoryPolicy& policy, |
| 185 bool discard_backbuffer_when_not_visible); | 189 bool discard_backbuffer_when_not_visible); |
| 186 | 190 |
| 187 // This stores a BeginFrame that we couldn't process immediately, but might | |
| 188 // process retroactively in the near future. | |
| 189 BeginFrameArgs skipped_begin_frame_args_; | |
| 190 | |
| 191 // check_for_retroactive_begin_frame_pending_ is used to avoid posting | 191 // check_for_retroactive_begin_frame_pending_ is used to avoid posting |
| 192 // redundant checks for a retroactive BeginFrame. | 192 // redundant checks for a retroactive BeginFrame. |
| 193 bool check_for_retroactive_begin_frame_pending_; | 193 bool check_for_retroactive_begin_frame_pending_; |
| 194 | 194 |
| 195 DISALLOW_COPY_AND_ASSIGN(OutputSurface); | 195 DISALLOW_COPY_AND_ASSIGN(OutputSurface); |
| 196 }; | 196 }; |
| 197 | 197 |
| 198 } // namespace cc | 198 } // namespace cc |
| 199 | 199 |
| 200 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ | 200 #endif // CC_OUTPUT_OUTPUT_SURFACE_H_ |
| OLD | NEW |