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