Chromium Code Reviews| 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 #include "cc/scheduler/scheduler_state_machine.h" | 5 #include "cc/scheduler/scheduler_state_machine.h" |
| 6 | 6 |
| 7 #include "base/format_macros.h" | 7 #include "base/format_macros.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 35 BeginFrameArgs::kInvalidFrameNumber), | 35 BeginFrameArgs::kInvalidFrameNumber), |
| 36 last_begin_frame_sequence_number_compositor_frame_was_fresh_( | 36 last_begin_frame_sequence_number_compositor_frame_was_fresh_( |
| 37 BeginFrameArgs::kInvalidFrameNumber), | 37 BeginFrameArgs::kInvalidFrameNumber), |
| 38 commit_count_(0), | 38 commit_count_(0), |
| 39 current_frame_number_(0), | 39 current_frame_number_(0), |
| 40 last_frame_number_submit_performed_(-1), | 40 last_frame_number_submit_performed_(-1), |
| 41 last_frame_number_draw_performed_(-1), | 41 last_frame_number_draw_performed_(-1), |
| 42 last_frame_number_begin_main_frame_sent_(-1), | 42 last_frame_number_begin_main_frame_sent_(-1), |
| 43 last_frame_number_invalidate_compositor_frame_sink_performed_(-1), | 43 last_frame_number_invalidate_compositor_frame_sink_performed_(-1), |
| 44 draw_funnel_(false), | 44 draw_funnel_(false), |
| 45 send_begin_main_frame_funnel_(true), | 45 did_send_begin_main_frame_for_current_frame_(true), |
| 46 invalidate_compositor_frame_sink_funnel_(false), | 46 invalidate_compositor_frame_sink_funnel_(false), |
| 47 impl_side_invalidation_funnel_(false), | 47 impl_side_invalidation_funnel_(false), |
| 48 did_notify_begin_main_frame_not_sent_(false), | |
| 49 did_commit_during_frame_(false), | |
| 48 prepare_tiles_funnel_(0), | 50 prepare_tiles_funnel_(0), |
| 49 consecutive_checkerboard_animations_(0), | 51 consecutive_checkerboard_animations_(0), |
| 50 pending_submit_frames_(0), | 52 pending_submit_frames_(0), |
| 51 submit_frames_with_current_compositor_frame_sink_(0), | 53 submit_frames_with_current_compositor_frame_sink_(0), |
| 52 needs_redraw_(false), | 54 needs_redraw_(false), |
| 53 needs_prepare_tiles_(false), | 55 needs_prepare_tiles_(false), |
| 54 needs_begin_main_frame_(false), | 56 needs_begin_main_frame_(false), |
| 55 needs_one_begin_impl_frame_(false), | 57 needs_one_begin_impl_frame_(false), |
| 56 visible_(false), | 58 visible_(false), |
| 57 begin_frame_source_paused_(false), | 59 begin_frame_source_paused_(false), |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 187 case ACTION_DRAW_ABORT: | 189 case ACTION_DRAW_ABORT: |
| 188 return "ACTION_DRAW_ABORT"; | 190 return "ACTION_DRAW_ABORT"; |
| 189 case ACTION_BEGIN_COMPOSITOR_FRAME_SINK_CREATION: | 191 case ACTION_BEGIN_COMPOSITOR_FRAME_SINK_CREATION: |
| 190 return "ACTION_BEGIN_COMPOSITOR_FRAME_SINK_CREATION"; | 192 return "ACTION_BEGIN_COMPOSITOR_FRAME_SINK_CREATION"; |
| 191 case ACTION_PREPARE_TILES: | 193 case ACTION_PREPARE_TILES: |
| 192 return "ACTION_PREPARE_TILES"; | 194 return "ACTION_PREPARE_TILES"; |
| 193 case ACTION_INVALIDATE_COMPOSITOR_FRAME_SINK: | 195 case ACTION_INVALIDATE_COMPOSITOR_FRAME_SINK: |
| 194 return "ACTION_INVALIDATE_COMPOSITOR_FRAME_SINK"; | 196 return "ACTION_INVALIDATE_COMPOSITOR_FRAME_SINK"; |
| 195 case ACTION_PERFORM_IMPL_SIDE_INVALIDATION: | 197 case ACTION_PERFORM_IMPL_SIDE_INVALIDATION: |
| 196 return "ACTION_PERFORM_IMPL_SIDE_INVALIDATION"; | 198 return "ACTION_PERFORM_IMPL_SIDE_INVALIDATION"; |
| 199 case ACTION_NOTIFY_BEGIN_MAIN_FRAME_NOT_SENT: | |
| 200 return "ACTION_NOTIFY_BEGIN_MAIN_FRAME_NOT_SENT"; | |
| 197 } | 201 } |
| 198 NOTREACHED(); | 202 NOTREACHED(); |
| 199 return "???"; | 203 return "???"; |
| 200 } | 204 } |
| 201 | 205 |
| 202 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> | 206 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> |
| 203 SchedulerStateMachine::AsValue() const { | 207 SchedulerStateMachine::AsValue() const { |
| 204 std::unique_ptr<base::trace_event::TracedValue> state( | 208 std::unique_ptr<base::trace_event::TracedValue> state( |
| 205 new base::trace_event::TracedValue()); | 209 new base::trace_event::TracedValue()); |
| 206 AsValueInto(state.get()); | 210 AsValueInto(state.get()); |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 237 state->SetInteger("last_begin_frame_sequence_number_begin_main_frame_sent", | 241 state->SetInteger("last_begin_frame_sequence_number_begin_main_frame_sent", |
| 238 last_begin_frame_sequence_number_begin_main_frame_sent_); | 242 last_begin_frame_sequence_number_begin_main_frame_sent_); |
| 239 state->SetInteger("last_begin_frame_sequence_number_pending_tree_was_fresh", | 243 state->SetInteger("last_begin_frame_sequence_number_pending_tree_was_fresh", |
| 240 last_begin_frame_sequence_number_pending_tree_was_fresh_); | 244 last_begin_frame_sequence_number_pending_tree_was_fresh_); |
| 241 state->SetInteger("last_begin_frame_sequence_number_active_tree_was_fresh", | 245 state->SetInteger("last_begin_frame_sequence_number_active_tree_was_fresh", |
| 242 last_begin_frame_sequence_number_active_tree_was_fresh_); | 246 last_begin_frame_sequence_number_active_tree_was_fresh_); |
| 243 state->SetInteger( | 247 state->SetInteger( |
| 244 "last_begin_frame_sequence_number_compositor_frame_was_fresh", | 248 "last_begin_frame_sequence_number_compositor_frame_was_fresh", |
| 245 last_begin_frame_sequence_number_compositor_frame_was_fresh_); | 249 last_begin_frame_sequence_number_compositor_frame_was_fresh_); |
| 246 state->SetBoolean("funnel: draw_funnel", draw_funnel_); | 250 state->SetBoolean("funnel: draw_funnel", draw_funnel_); |
| 247 state->SetBoolean("funnel: send_begin_main_frame_funnel", | 251 state->SetBoolean("funnel: did_send_begin_main_frame", |
| 248 send_begin_main_frame_funnel_); | 252 did_send_begin_main_frame_for_current_frame_); |
| 253 state->SetBoolean("funnel: did_notify_begin_main_frame_not_sent", | |
| 254 did_notify_begin_main_frame_not_sent_); | |
| 255 state->SetBoolean("funnel: did_commit_during_frame", | |
| 256 did_commit_during_frame_); | |
| 249 state->SetInteger("funnel: prepare_tiles_funnel", prepare_tiles_funnel_); | 257 state->SetInteger("funnel: prepare_tiles_funnel", prepare_tiles_funnel_); |
| 250 state->SetBoolean("funnel: invalidate_compositor_frame_sink_funnel", | 258 state->SetBoolean("funnel: invalidate_compositor_frame_sink_funnel", |
| 251 invalidate_compositor_frame_sink_funnel_); | 259 invalidate_compositor_frame_sink_funnel_); |
| 252 state->SetBoolean("funnel: impl_side_invalidation_funnel", | 260 state->SetBoolean("funnel: impl_side_invalidation_funnel", |
| 253 impl_side_invalidation_funnel_); | 261 impl_side_invalidation_funnel_); |
| 254 state->SetInteger("consecutive_checkerboard_animations", | 262 state->SetInteger("consecutive_checkerboard_animations", |
| 255 consecutive_checkerboard_animations_); | 263 consecutive_checkerboard_animations_); |
| 256 state->SetInteger("pending_submit_frames_", pending_submit_frames_); | 264 state->SetInteger("pending_submit_frames_", pending_submit_frames_); |
| 257 state->SetInteger("submit_frames_with_current_compositor_frame_sink", | 265 state->SetInteger("submit_frames_with_current_compositor_frame_sink", |
| 258 submit_frames_with_current_compositor_frame_sink_); | 266 submit_frames_with_current_compositor_frame_sink_); |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 421 return false; | 429 return false; |
| 422 | 430 |
| 423 // If we want to force activation, do so ASAP. | 431 // If we want to force activation, do so ASAP. |
| 424 if (PendingActivationsShouldBeForced()) | 432 if (PendingActivationsShouldBeForced()) |
| 425 return true; | 433 return true; |
| 426 | 434 |
| 427 // At this point, only activate if we are ready to activate. | 435 // At this point, only activate if we are ready to activate. |
| 428 return pending_tree_is_ready_for_activation_; | 436 return pending_tree_is_ready_for_activation_; |
| 429 } | 437 } |
| 430 | 438 |
| 439 bool SchedulerStateMachine::ShouldNotifyBeginMainFrameNotSent() const { | |
| 440 // BeginMainFrame already triggers idle work, so we don't need to schedule | |
|
Sami
2017/04/06 17:39:09
I'm wondering if we should rephrase all these comm
Dan Elphick
2017/04/07 09:05:02
I think you're right. I've phrased most of the com
| |
| 441 // extra idle work here. | |
| 442 if (needs_begin_main_frame_ || did_send_begin_main_frame_for_current_frame_) | |
| 443 return false; | |
| 444 | |
| 445 // Only schedule extra idle work when we're visible. | |
| 446 if (!visible_) | |
| 447 return false; | |
| 448 | |
| 449 // There are no BeginImplFrames while BeginFrameSource is paused, | |
| 450 // so should also stop scheduling extra idle work. | |
| 451 if (begin_frame_source_paused_) | |
| 452 return false; | |
| 453 | |
| 454 // Do not notify that no BeginMainFrame was sent too many times in a single | |
| 455 // frame. | |
| 456 if (did_notify_begin_main_frame_not_sent_) | |
| 457 return false; | |
| 458 | |
| 459 // Do not notify if a commit happened during this frame as idle work will be | |
| 460 // scheduled after that anyway. (This occurs if the main frame was scheduled | |
| 461 // but didn't complete before the vsync deadline). | |
| 462 if (did_commit_during_frame_) | |
| 463 return false; | |
| 464 | |
| 465 // If a BeginMainFrame is in progress, don't do any extra idle work. | |
| 466 if (begin_main_frame_state_ != BEGIN_MAIN_FRAME_STATE_IDLE) | |
| 467 return false; | |
| 468 | |
| 469 return true; | |
| 470 } | |
| 471 | |
| 431 bool SchedulerStateMachine::CouldSendBeginMainFrame() const { | 472 bool SchedulerStateMachine::CouldSendBeginMainFrame() const { |
| 432 if (!needs_begin_main_frame_) | 473 if (!needs_begin_main_frame_) |
| 433 return false; | 474 return false; |
| 434 | 475 |
| 435 // We can not perform commits if we are not visible. | 476 // We can not perform commits if we are not visible. |
| 436 if (!visible_) | 477 if (!visible_) |
| 437 return false; | 478 return false; |
| 438 | 479 |
| 439 // There are no BeginImplFrames while BeginFrameSource is paused, | 480 // There are no BeginImplFrames while BeginFrameSource is paused, |
| 440 // so should also stop BeginMainFrames. | 481 // so should also stop BeginMainFrames. |
| 441 if (begin_frame_source_paused_) | 482 if (begin_frame_source_paused_) |
| 442 return false; | 483 return false; |
| 443 | 484 |
| 444 // Do not make a new commits when it is deferred. | 485 // Do not make a new commits when it is deferred. |
| 445 if (defer_commits_) | 486 if (defer_commits_) |
| 446 return false; | 487 return false; |
| 447 | 488 |
| 448 return true; | 489 return true; |
| 449 } | 490 } |
| 450 | 491 |
| 451 bool SchedulerStateMachine::ShouldSendBeginMainFrame() const { | 492 bool SchedulerStateMachine::ShouldSendBeginMainFrame() const { |
| 452 if (!CouldSendBeginMainFrame()) | 493 if (!CouldSendBeginMainFrame()) |
| 453 return false; | 494 return false; |
| 454 | 495 |
| 455 // Do not send begin main frame too many times in a single frame or before | 496 // Do not send begin main frame too many times in a single frame or before |
| 456 // the first BeginFrame. | 497 // the first BeginFrame. |
| 457 if (send_begin_main_frame_funnel_) | 498 if (did_send_begin_main_frame_for_current_frame_) |
| 458 return false; | 499 return false; |
| 459 | 500 |
| 460 // Only send BeginMainFrame when there isn't another commit pending already. | 501 // Only send BeginMainFrame when there isn't another commit pending already. |
| 461 // Other parts of the state machine indirectly defer the BeginMainFrame | 502 // Other parts of the state machine indirectly defer the BeginMainFrame |
| 462 // by transitioning to WAITING commit states rather than going | 503 // by transitioning to WAITING commit states rather than going |
| 463 // immediately to IDLE. | 504 // immediately to IDLE. |
| 464 if (begin_main_frame_state_ != BEGIN_MAIN_FRAME_STATE_IDLE) | 505 if (begin_main_frame_state_ != BEGIN_MAIN_FRAME_STATE_IDLE) |
| 465 return false; | 506 return false; |
| 466 | 507 |
| 467 // MFBA is disabled and we are waiting for previous activation. | 508 // MFBA is disabled and we are waiting for previous activation. |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 591 if (ShouldPerformImplSideInvalidation()) | 632 if (ShouldPerformImplSideInvalidation()) |
| 592 return ACTION_PERFORM_IMPL_SIDE_INVALIDATION; | 633 return ACTION_PERFORM_IMPL_SIDE_INVALIDATION; |
| 593 if (ShouldPrepareTiles()) | 634 if (ShouldPrepareTiles()) |
| 594 return ACTION_PREPARE_TILES; | 635 return ACTION_PREPARE_TILES; |
| 595 if (ShouldSendBeginMainFrame()) | 636 if (ShouldSendBeginMainFrame()) |
| 596 return ACTION_SEND_BEGIN_MAIN_FRAME; | 637 return ACTION_SEND_BEGIN_MAIN_FRAME; |
| 597 if (ShouldInvalidateCompositorFrameSink()) | 638 if (ShouldInvalidateCompositorFrameSink()) |
| 598 return ACTION_INVALIDATE_COMPOSITOR_FRAME_SINK; | 639 return ACTION_INVALIDATE_COMPOSITOR_FRAME_SINK; |
| 599 if (ShouldBeginCompositorFrameSinkCreation()) | 640 if (ShouldBeginCompositorFrameSinkCreation()) |
| 600 return ACTION_BEGIN_COMPOSITOR_FRAME_SINK_CREATION; | 641 return ACTION_BEGIN_COMPOSITOR_FRAME_SINK_CREATION; |
| 642 if (ShouldNotifyBeginMainFrameNotSent()) | |
| 643 return ACTION_NOTIFY_BEGIN_MAIN_FRAME_NOT_SENT; | |
| 601 return ACTION_NONE; | 644 return ACTION_NONE; |
| 602 } | 645 } |
| 603 | 646 |
| 604 bool SchedulerStateMachine::ShouldPerformImplSideInvalidation() const { | 647 bool SchedulerStateMachine::ShouldPerformImplSideInvalidation() const { |
| 605 if (!needs_impl_side_invalidation_) | 648 if (!needs_impl_side_invalidation_) |
| 606 return false; | 649 return false; |
| 607 | 650 |
| 608 if (!CouldCreatePendingTree()) | 651 if (!CouldCreatePendingTree()) |
| 609 return false; | 652 return false; |
| 610 | 653 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 676 if (!HasInitializedCompositorFrameSink()) | 719 if (!HasInitializedCompositorFrameSink()) |
| 677 return false; | 720 return false; |
| 678 | 721 |
| 679 return true; | 722 return true; |
| 680 } | 723 } |
| 681 | 724 |
| 682 void SchedulerStateMachine::WillSendBeginMainFrame() { | 725 void SchedulerStateMachine::WillSendBeginMainFrame() { |
| 683 DCHECK(!has_pending_tree_ || settings_.main_frame_before_activation_enabled); | 726 DCHECK(!has_pending_tree_ || settings_.main_frame_before_activation_enabled); |
| 684 DCHECK(visible_); | 727 DCHECK(visible_); |
| 685 DCHECK(!begin_frame_source_paused_); | 728 DCHECK(!begin_frame_source_paused_); |
| 686 DCHECK(!send_begin_main_frame_funnel_); | 729 DCHECK(!did_send_begin_main_frame_for_current_frame_); |
| 687 begin_main_frame_state_ = BEGIN_MAIN_FRAME_STATE_SENT; | 730 begin_main_frame_state_ = BEGIN_MAIN_FRAME_STATE_SENT; |
| 688 needs_begin_main_frame_ = false; | 731 needs_begin_main_frame_ = false; |
| 689 send_begin_main_frame_funnel_ = true; | 732 did_send_begin_main_frame_for_current_frame_ = true; |
| 690 last_frame_number_begin_main_frame_sent_ = current_frame_number_; | 733 last_frame_number_begin_main_frame_sent_ = current_frame_number_; |
| 691 last_begin_frame_sequence_number_begin_main_frame_sent_ = | 734 last_begin_frame_sequence_number_begin_main_frame_sent_ = |
| 692 begin_frame_sequence_number_; | 735 begin_frame_sequence_number_; |
| 693 } | 736 } |
| 694 | 737 |
| 738 void SchedulerStateMachine::WillNotifyBeginMainFrameNotSent() { | |
| 739 DCHECK(visible_); | |
| 740 DCHECK(!begin_frame_source_paused_); | |
| 741 DCHECK(!did_notify_begin_main_frame_not_sent_); | |
| 742 did_notify_begin_main_frame_not_sent_ = true; | |
| 743 } | |
| 744 | |
| 695 void SchedulerStateMachine::WillCommit(bool commit_has_no_updates) { | 745 void SchedulerStateMachine::WillCommit(bool commit_has_no_updates) { |
| 696 bool can_have_pending_tree = | 746 bool can_have_pending_tree = |
| 697 commit_has_no_updates && | 747 commit_has_no_updates && |
| 698 (settings_.main_frame_before_activation_enabled || | 748 (settings_.main_frame_before_activation_enabled || |
| 699 current_pending_tree_is_impl_side_); | 749 current_pending_tree_is_impl_side_); |
| 700 DCHECK(!has_pending_tree_ || can_have_pending_tree); | 750 DCHECK(!has_pending_tree_ || can_have_pending_tree); |
| 701 commit_count_++; | 751 commit_count_++; |
| 702 last_commit_had_no_updates_ = commit_has_no_updates; | 752 last_commit_had_no_updates_ = commit_has_no_updates; |
| 703 begin_main_frame_state_ = BEGIN_MAIN_FRAME_STATE_IDLE; | 753 begin_main_frame_state_ = BEGIN_MAIN_FRAME_STATE_IDLE; |
| 754 did_commit_during_frame_ = true; | |
| 704 | 755 |
| 705 if (commit_has_no_updates) { | 756 if (commit_has_no_updates) { |
| 706 // Pending tree might still exist from prior commit. | 757 // Pending tree might still exist from prior commit. |
| 707 if (has_pending_tree_) { | 758 if (has_pending_tree_) { |
| 708 DCHECK(can_have_pending_tree); | 759 DCHECK(can_have_pending_tree); |
| 709 last_begin_frame_sequence_number_pending_tree_was_fresh_ = | 760 last_begin_frame_sequence_number_pending_tree_was_fresh_ = |
| 710 last_begin_frame_sequence_number_begin_main_frame_sent_; | 761 last_begin_frame_sequence_number_begin_main_frame_sent_; |
| 711 } else { | 762 } else { |
| 712 if (last_begin_frame_sequence_number_compositor_frame_was_fresh_ == | 763 if (last_begin_frame_sequence_number_compositor_frame_was_fresh_ == |
| 713 last_begin_frame_sequence_number_active_tree_was_fresh_) { | 764 last_begin_frame_sequence_number_active_tree_was_fresh_) { |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1040 | 1091 |
| 1041 begin_impl_frame_state_ = BEGIN_IMPL_FRAME_STATE_INSIDE_BEGIN_FRAME; | 1092 begin_impl_frame_state_ = BEGIN_IMPL_FRAME_STATE_INSIDE_BEGIN_FRAME; |
| 1042 current_frame_number_++; | 1093 current_frame_number_++; |
| 1043 | 1094 |
| 1044 last_commit_had_no_updates_ = false; | 1095 last_commit_had_no_updates_ = false; |
| 1045 did_draw_in_last_frame_ = false; | 1096 did_draw_in_last_frame_ = false; |
| 1046 did_submit_in_last_frame_ = false; | 1097 did_submit_in_last_frame_ = false; |
| 1047 needs_one_begin_impl_frame_ = false; | 1098 needs_one_begin_impl_frame_ = false; |
| 1048 | 1099 |
| 1049 // Clear funnels for any actions we perform during the frame. | 1100 // Clear funnels for any actions we perform during the frame. |
| 1050 send_begin_main_frame_funnel_ = false; | 1101 did_notify_begin_main_frame_not_sent_ = false; |
| 1102 did_send_begin_main_frame_for_current_frame_ = false; | |
| 1103 did_commit_during_frame_ = false; | |
| 1051 invalidate_compositor_frame_sink_funnel_ = false; | 1104 invalidate_compositor_frame_sink_funnel_ = false; |
| 1052 impl_side_invalidation_funnel_ = false; | 1105 impl_side_invalidation_funnel_ = false; |
| 1053 | 1106 |
| 1054 // "Drain" the PrepareTiles funnel. | 1107 // "Drain" the PrepareTiles funnel. |
| 1055 if (prepare_tiles_funnel_ > 0) | 1108 if (prepare_tiles_funnel_ > 0) |
| 1056 prepare_tiles_funnel_--; | 1109 prepare_tiles_funnel_--; |
| 1057 } | 1110 } |
| 1058 | 1111 |
| 1059 void SchedulerStateMachine::OnBeginImplFrameDeadline() { | 1112 void SchedulerStateMachine::OnBeginImplFrameDeadline() { |
| 1060 begin_impl_frame_state_ = BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE; | 1113 begin_impl_frame_state_ = BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE; |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 1078 skip_next_begin_main_frame_to_reduce_latency_ = false; | 1131 skip_next_begin_main_frame_to_reduce_latency_ = false; |
| 1079 | 1132 |
| 1080 // If a new or undrawn active tree is pending after the deadline, | 1133 // If a new or undrawn active tree is pending after the deadline, |
| 1081 // then the main thread is in a high latency mode. | 1134 // then the main thread is in a high latency mode. |
| 1082 main_thread_missed_last_deadline_ = | 1135 main_thread_missed_last_deadline_ = |
| 1083 CommitPending() || has_pending_tree_ || active_tree_needs_first_draw_; | 1136 CommitPending() || has_pending_tree_ || active_tree_needs_first_draw_; |
| 1084 | 1137 |
| 1085 // If we're entering a state where we won't get BeginFrames set all the | 1138 // If we're entering a state where we won't get BeginFrames set all the |
| 1086 // funnels so that we don't perform any actions that we shouldn't. | 1139 // funnels so that we don't perform any actions that we shouldn't. |
| 1087 if (!BeginFrameNeeded()) | 1140 if (!BeginFrameNeeded()) |
| 1088 send_begin_main_frame_funnel_ = true; | 1141 did_send_begin_main_frame_for_current_frame_ = true; |
| 1089 | 1142 |
| 1090 // Synchronous compositor finishes BeginFrames before triggering their | 1143 // Synchronous compositor finishes BeginFrames before triggering their |
| 1091 // deadline. Therefore, we update sequence numbers when becoming idle, before | 1144 // deadline. Therefore, we update sequence numbers when becoming idle, before |
| 1092 // the Scheduler sends its BeginFrameAck. | 1145 // the Scheduler sends its BeginFrameAck. |
| 1093 if (settings_.using_synchronous_renderer_compositor) | 1146 if (settings_.using_synchronous_renderer_compositor) |
| 1094 UpdateBeginFrameSequenceNumbersForBeginFrameDeadline(); | 1147 UpdateBeginFrameSequenceNumbersForBeginFrameDeadline(); |
| 1095 } | 1148 } |
| 1096 | 1149 |
| 1097 SchedulerStateMachine::BeginImplFrameDeadlineMode | 1150 SchedulerStateMachine::BeginImplFrameDeadlineMode |
| 1098 SchedulerStateMachine::CurrentBeginImplFrameDeadlineMode() const { | 1151 SchedulerStateMachine::CurrentBeginImplFrameDeadlineMode() const { |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1335 case COMPOSITOR_FRAME_SINK_ACTIVE: | 1388 case COMPOSITOR_FRAME_SINK_ACTIVE: |
| 1336 case COMPOSITOR_FRAME_SINK_WAITING_FOR_FIRST_COMMIT: | 1389 case COMPOSITOR_FRAME_SINK_WAITING_FOR_FIRST_COMMIT: |
| 1337 case COMPOSITOR_FRAME_SINK_WAITING_FOR_FIRST_ACTIVATION: | 1390 case COMPOSITOR_FRAME_SINK_WAITING_FOR_FIRST_ACTIVATION: |
| 1338 return true; | 1391 return true; |
| 1339 } | 1392 } |
| 1340 NOTREACHED(); | 1393 NOTREACHED(); |
| 1341 return false; | 1394 return false; |
| 1342 } | 1395 } |
| 1343 | 1396 |
| 1344 } // namespace cc | 1397 } // namespace cc |
| OLD | NEW |