| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ | 5 #ifndef CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ |
| 6 #define CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ | 6 #define CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 | 124 |
| 125 scoped_ptr<base::Value> AsValue() const; | 125 scoped_ptr<base::Value> AsValue() const; |
| 126 | 126 |
| 127 Action NextAction() const; | 127 Action NextAction() const; |
| 128 void UpdateState(Action action); | 128 void UpdateState(Action action); |
| 129 | 129 |
| 130 void CheckInvariants(); | 130 void CheckInvariants(); |
| 131 | 131 |
| 132 // Indicates whether the impl thread needs a BeginImplFrame callback in order | 132 // Indicates whether the impl thread needs a BeginImplFrame callback in order |
| 133 // to make progress. | 133 // to make progress. |
| 134 bool BeginImplFrameNeeded() const; | 134 bool BeginFrameNeeded() const; |
| 135 | 135 |
| 136 // Indicates that we need to independently poll for new state and actions | 136 // Indicates that we need to independently poll for new state and actions |
| 137 // because we can't expect a BeginImplFrame. This is mostly used to avoid | 137 // because we can't expect a BeginImplFrame. This is mostly used to avoid |
| 138 // drawing repeat frames with the synchronous compositor without dropping | 138 // drawing repeat frames with the synchronous compositor without dropping |
| 139 // necessary actions on the floor. | 139 // necessary actions on the floor. |
| 140 bool ShouldPollForAnticipatedDrawTriggers() const; | 140 bool ShouldPollForAnticipatedDrawTriggers() const; |
| 141 | 141 |
| 142 // Indicates that the system has entered and left a BeginImplFrame callback. | 142 // Indicates that the system has entered and left a BeginImplFrame callback. |
| 143 // The scheduler will not draw more than once in a given BeginImplFrame | 143 // The scheduler will not draw more than once in a given BeginImplFrame |
| 144 // callback nor send more than one BeginMainFrame message. | 144 // callback nor send more than one BeginMainFrame message. |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 } | 238 } |
| 239 | 239 |
| 240 void DidManageTiles(); | 240 void DidManageTiles(); |
| 241 void DidLoseOutputSurface(); | 241 void DidLoseOutputSurface(); |
| 242 void DidCreateAndInitializeOutputSurface(); | 242 void DidCreateAndInitializeOutputSurface(); |
| 243 bool HasInitializedOutputSurface() const; | 243 bool HasInitializedOutputSurface() const; |
| 244 | 244 |
| 245 // True if we need to abort draws to make forward progress. | 245 // True if we need to abort draws to make forward progress. |
| 246 bool PendingDrawsShouldBeAborted() const; | 246 bool PendingDrawsShouldBeAborted() const; |
| 247 | 247 |
| 248 bool SupportsProactiveBeginImplFrame() const; | 248 bool SupportsProactiveBeginFrame() const; |
| 249 | 249 |
| 250 protected: | 250 protected: |
| 251 bool BeginImplFrameNeededToDraw() const; | 251 bool BeginFrameNeededToDraw() const; |
| 252 bool ProactiveBeginImplFrameWanted() const; | 252 bool ProactiveBeginFrameWanted() const; |
| 253 | 253 |
| 254 // True if we need to force activations to make forward progress. | 254 // True if we need to force activations to make forward progress. |
| 255 bool PendingActivationsShouldBeForced() const; | 255 bool PendingActivationsShouldBeForced() const; |
| 256 | 256 |
| 257 bool ShouldBeginOutputSurfaceCreation() const; | 257 bool ShouldBeginOutputSurfaceCreation() const; |
| 258 bool ShouldDrawForced() const; | 258 bool ShouldDrawForced() const; |
| 259 bool ShouldDraw() const; | 259 bool ShouldDraw() const; |
| 260 bool ShouldActivatePendingTree() const; | 260 bool ShouldActivatePendingTree() const; |
| 261 bool ShouldAcquireLayerTexturesForMainThread() const; | 261 bool ShouldAcquireLayerTexturesForMainThread() const; |
| 262 bool ShouldUpdateVisibleTiles() const; | 262 bool ShouldUpdateVisibleTiles() const; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 277 | 277 |
| 278 const SchedulerSettings settings_; | 278 const SchedulerSettings settings_; |
| 279 | 279 |
| 280 OutputSurfaceState output_surface_state_; | 280 OutputSurfaceState output_surface_state_; |
| 281 BeginImplFrameState begin_impl_frame_state_; | 281 BeginImplFrameState begin_impl_frame_state_; |
| 282 CommitState commit_state_; | 282 CommitState commit_state_; |
| 283 TextureState texture_state_; | 283 TextureState texture_state_; |
| 284 ForcedRedrawOnTimeoutState forced_redraw_state_; | 284 ForcedRedrawOnTimeoutState forced_redraw_state_; |
| 285 SynchronousReadbackState readback_state_; | 285 SynchronousReadbackState readback_state_; |
| 286 | 286 |
| 287 BeginFrameArgs last_begin_impl_frame_args_; | 287 BeginFrameArgs begin_impl_frame_args_; |
| 288 | 288 |
| 289 int commit_count_; | 289 int commit_count_; |
| 290 int current_frame_number_; | 290 int current_frame_number_; |
| 291 int last_frame_number_swap_performed_; | 291 int last_frame_number_swap_performed_; |
| 292 int last_frame_number_begin_main_frame_sent_; | 292 int last_frame_number_begin_main_frame_sent_; |
| 293 int last_frame_number_update_visible_tiles_was_called_; | 293 int last_frame_number_update_visible_tiles_was_called_; |
| 294 | 294 |
| 295 // manage_tiles_funnel_ is "filled" each time ManageTiles is called | 295 // manage_tiles_funnel_ is "filled" each time ManageTiles is called |
| 296 // and "drained" on each BeginImplFrame. If the funnel gets too full, | 296 // and "drained" on each BeginImplFrame. If the funnel gets too full, |
| 297 // we start throttling ACTION_MANAGE_TILES such that we average one | 297 // we start throttling ACTION_MANAGE_TILES such that we average one |
| (...skipping 18 matching lines...) Expand all Loading... |
| 316 bool skip_next_begin_main_frame_to_reduce_latency_; | 316 bool skip_next_begin_main_frame_to_reduce_latency_; |
| 317 bool skip_begin_main_frame_to_reduce_latency_; | 317 bool skip_begin_main_frame_to_reduce_latency_; |
| 318 | 318 |
| 319 private: | 319 private: |
| 320 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); | 320 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); |
| 321 }; | 321 }; |
| 322 | 322 |
| 323 } // namespace cc | 323 } // namespace cc |
| 324 | 324 |
| 325 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ | 325 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ |
| OLD | NEW |