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