| 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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 | 158 |
| 159 void SetNeedsAnimate(); | 159 void SetNeedsAnimate(); |
| 160 bool needs_animate() const { return needs_animate_; } | 160 bool needs_animate() const { return needs_animate_; } |
| 161 | 161 |
| 162 bool OnlyImplSideUpdatesExpected() const; | 162 bool OnlyImplSideUpdatesExpected() const; |
| 163 | 163 |
| 164 // Indicates that prepare-tiles is required. This guarantees another | 164 // Indicates that prepare-tiles is required. This guarantees another |
| 165 // PrepareTiles will occur shortly (even if no redraw is required). | 165 // PrepareTiles will occur shortly (even if no redraw is required). |
| 166 void SetNeedsPrepareTiles(); | 166 void SetNeedsPrepareTiles(); |
| 167 | 167 |
| 168 // Make deadline wait for ReadyToDraw signal. | |
| 169 void SetWaitForReadyToDraw(); | |
| 170 | |
| 171 // Sets how many swaps can be pending to the OutputSurface. | 168 // Sets how many swaps can be pending to the OutputSurface. |
| 172 void SetMaxSwapsPending(int max); | 169 void SetMaxSwapsPending(int max); |
| 173 | 170 |
| 174 // If the scheduler attempted to draw and swap, this provides feedback | 171 // If the scheduler attempted to draw and swap, this provides feedback |
| 175 // regarding whether or not the swap actually occured. We might skip the | 172 // regarding whether or not the swap actually occured. We might skip the |
| 176 // swap when there is not damage, for example. | 173 // swap when there is not damage, for example. |
| 177 void DidSwapBuffers(); | 174 void DidSwapBuffers(); |
| 178 | 175 |
| 179 // Indicates whether a redraw is required because we are currently rendering | 176 // Indicates whether a redraw is required because we are currently rendering |
| 180 // with a low resolution or checkerboarded tile. | 177 // with a low resolution or checkerboarded tile. |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 | 260 |
| 264 protected: | 261 protected: |
| 265 bool BeginFrameRequiredForAction() const; | 262 bool BeginFrameRequiredForAction() const; |
| 266 bool BeginFrameRequiredForChildren() const; | 263 bool BeginFrameRequiredForChildren() const; |
| 267 bool BeginFrameNeededForVideo() const; | 264 bool BeginFrameNeededForVideo() const; |
| 268 bool ProactiveBeginFrameWanted() const; | 265 bool ProactiveBeginFrameWanted() const; |
| 269 | 266 |
| 270 bool ShouldTriggerBeginImplFrameDeadlineImmediately() const; | 267 bool ShouldTriggerBeginImplFrameDeadlineImmediately() const; |
| 271 | 268 |
| 272 // True if we need to force activations to make forward progress. | 269 // True if we need to force activations to make forward progress. |
| 270 // TODO(sunnyps): Rename this to ShouldAbortCurrentFrame or similar. |
| 273 bool PendingActivationsShouldBeForced() const; | 271 bool PendingActivationsShouldBeForced() const; |
| 274 | 272 |
| 275 // TODO(brianderson): Remove this once NPAPI support is removed. | 273 // TODO(brianderson): Remove this once NPAPI support is removed. |
| 276 bool SendingBeginMainFrameMightCauseDeadlock() const; | 274 bool SendingBeginMainFrameMightCauseDeadlock() const; |
| 277 | 275 |
| 278 bool ShouldAnimate() const; | 276 bool ShouldAnimate() const; |
| 279 bool ShouldBeginOutputSurfaceCreation() const; | 277 bool ShouldBeginOutputSurfaceCreation() const; |
| 280 bool ShouldDraw() const; | 278 bool ShouldDraw() const; |
| 281 bool ShouldActivatePendingTree() const; | 279 bool ShouldActivatePendingTree() const; |
| 282 bool ShouldSendBeginMainFrame() const; | 280 bool ShouldSendBeginMainFrame() const; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 bool active_tree_needs_first_draw_; | 335 bool active_tree_needs_first_draw_; |
| 338 bool did_create_and_initialize_first_output_surface_; | 336 bool did_create_and_initialize_first_output_surface_; |
| 339 bool impl_latency_takes_priority_; | 337 bool impl_latency_takes_priority_; |
| 340 bool main_thread_missed_last_deadline_; | 338 bool main_thread_missed_last_deadline_; |
| 341 bool skip_next_begin_main_frame_to_reduce_latency_; | 339 bool skip_next_begin_main_frame_to_reduce_latency_; |
| 342 bool continuous_painting_; | 340 bool continuous_painting_; |
| 343 bool children_need_begin_frames_; | 341 bool children_need_begin_frames_; |
| 344 bool defer_commits_; | 342 bool defer_commits_; |
| 345 bool video_needs_begin_frames_; | 343 bool video_needs_begin_frames_; |
| 346 bool last_commit_had_no_updates_; | 344 bool last_commit_had_no_updates_; |
| 347 bool wait_for_active_tree_ready_to_draw_; | 345 bool wait_for_ready_to_draw_; |
| 348 bool did_request_swap_in_last_frame_; | 346 bool did_request_swap_in_last_frame_; |
| 349 bool did_perform_swap_in_last_draw_; | 347 bool did_perform_swap_in_last_draw_; |
| 350 | 348 |
| 351 private: | 349 private: |
| 352 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); | 350 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); |
| 353 }; | 351 }; |
| 354 | 352 |
| 355 } // namespace cc | 353 } // namespace cc |
| 356 | 354 |
| 357 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ | 355 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ |
| OLD | NEW |