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 <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 // True if we need to abort draws to make forward progress. | 263 // True if we need to abort draws to make forward progress. |
264 bool PendingDrawsShouldBeAborted() const; | 264 bool PendingDrawsShouldBeAborted() const; |
265 | 265 |
266 bool CouldSendBeginMainFrame() const; | 266 bool CouldSendBeginMainFrame() const; |
267 | 267 |
268 void SetDeferCommits(bool defer_commits); | 268 void SetDeferCommits(bool defer_commits); |
269 | 269 |
270 void SetVideoNeedsBeginFrames(bool video_needs_begin_frames); | 270 void SetVideoNeedsBeginFrames(bool video_needs_begin_frames); |
271 bool video_needs_begin_frames() const { return video_needs_begin_frames_; } | 271 bool video_needs_begin_frames() const { return video_needs_begin_frames_; } |
272 | 272 |
| 273 void SetBeginFrameAllowsLatencyOptimizations( |
| 274 bool allow_latency_optimizations); |
| 275 |
273 protected: | 276 protected: |
274 bool BeginFrameRequiredForAction() const; | 277 bool BeginFrameRequiredForAction() const; |
275 bool BeginFrameNeededForVideo() const; | 278 bool BeginFrameNeededForVideo() const; |
276 bool ProactiveBeginFrameWanted() const; | 279 bool ProactiveBeginFrameWanted() const; |
277 | 280 |
278 bool ShouldTriggerBeginImplFrameDeadlineImmediately() const; | 281 bool ShouldTriggerBeginImplFrameDeadlineImmediately() const; |
279 | 282 |
280 // True if we need to force activations to make forward progress. | 283 // True if we need to force activations to make forward progress. |
281 // TODO(sunnyps): Rename this to ShouldAbortCurrentFrame or similar. | 284 // TODO(sunnyps): Rename this to ShouldAbortCurrentFrame or similar. |
282 bool PendingActivationsShouldBeForced() const; | 285 bool PendingActivationsShouldBeForced() const; |
283 | 286 |
284 bool ShouldBeginCompositorFrameSinkCreation() const; | 287 bool ShouldBeginCompositorFrameSinkCreation() const; |
285 bool ShouldDraw() const; | 288 bool ShouldDraw() const; |
| 289 bool ShouldForceDraw() const; |
286 bool ShouldActivatePendingTree() const; | 290 bool ShouldActivatePendingTree() const; |
287 bool ShouldSendBeginMainFrame() const; | 291 bool ShouldSendBeginMainFrame() const; |
288 bool ShouldCommit() const; | 292 bool ShouldCommit() const; |
289 bool ShouldPrepareTiles() const; | 293 bool ShouldPrepareTiles() const; |
290 bool ShouldInvalidateCompositorFrameSink() const; | 294 bool ShouldInvalidateCompositorFrameSink() const; |
291 | 295 |
292 void WillDrawInternal(); | 296 void WillDrawInternal(); |
293 void DidDrawInternal(DrawResult draw_result); | 297 void DidDrawInternal(DrawResult draw_result); |
294 | 298 |
295 const SchedulerSettings settings_; | 299 const SchedulerSettings settings_; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 ScrollHandlerState scroll_handler_state_; | 341 ScrollHandlerState scroll_handler_state_; |
338 bool critical_begin_main_frame_to_activate_is_fast_; | 342 bool critical_begin_main_frame_to_activate_is_fast_; |
339 bool main_thread_missed_last_deadline_; | 343 bool main_thread_missed_last_deadline_; |
340 bool skip_next_begin_main_frame_to_reduce_latency_; | 344 bool skip_next_begin_main_frame_to_reduce_latency_; |
341 bool defer_commits_; | 345 bool defer_commits_; |
342 bool video_needs_begin_frames_; | 346 bool video_needs_begin_frames_; |
343 bool last_commit_had_no_updates_; | 347 bool last_commit_had_no_updates_; |
344 bool wait_for_ready_to_draw_; | 348 bool wait_for_ready_to_draw_; |
345 bool did_draw_in_last_frame_; | 349 bool did_draw_in_last_frame_; |
346 bool did_submit_in_last_frame_; | 350 bool did_submit_in_last_frame_; |
| 351 bool begin_frame_allows_latency_optimizations_; |
347 | 352 |
348 private: | 353 private: |
349 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); | 354 DISALLOW_COPY_AND_ASSIGN(SchedulerStateMachine); |
350 }; | 355 }; |
351 | 356 |
352 } // namespace cc | 357 } // namespace cc |
353 | 358 |
354 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ | 359 #endif // CC_SCHEDULER_SCHEDULER_STATE_MACHINE_H_ |
OLD | NEW |