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" |
| 11 #include "base/trace_event/trace_event_argument.h" | 11 #include "base/trace_event/trace_event_argument.h" |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "cc/output/begin_frame_args.h" | |
| 13 | 14 |
| 14 namespace cc { | 15 namespace cc { |
| 15 | 16 |
| 16 namespace { | 17 namespace { |
| 17 // Surfaces and CompositorTimingHistory don't support more than 1 pending swap. | 18 // Surfaces and CompositorTimingHistory don't support more than 1 pending swap. |
| 18 const int kMaxPendingSubmitFrames = 1; | 19 const int kMaxPendingSubmitFrames = 1; |
| 19 } // namespace | 20 } // namespace |
| 20 | 21 |
| 21 SchedulerStateMachine::SchedulerStateMachine(const SchedulerSettings& settings) | 22 SchedulerStateMachine::SchedulerStateMachine(const SchedulerSettings& settings) |
| 22 : settings_(settings), | 23 : settings_(settings), |
| 23 compositor_frame_sink_state_(COMPOSITOR_FRAME_SINK_NONE), | 24 compositor_frame_sink_state_(COMPOSITOR_FRAME_SINK_NONE), |
| 24 begin_impl_frame_state_(BEGIN_IMPL_FRAME_STATE_IDLE), | 25 begin_impl_frame_state_(BEGIN_IMPL_FRAME_STATE_IDLE), |
| 25 begin_main_frame_state_(BEGIN_MAIN_FRAME_STATE_IDLE), | 26 begin_main_frame_state_(BEGIN_MAIN_FRAME_STATE_IDLE), |
| 26 forced_redraw_state_(FORCED_REDRAW_STATE_IDLE), | 27 forced_redraw_state_(FORCED_REDRAW_STATE_IDLE), |
| 28 begin_frame_source_id_(0), | |
| 29 begin_frame_sequence_number_(BeginFrameArgs::kInvalidFrameNumber), | |
| 30 last_begin_frame_sequence_number_begin_main_frame_sent_( | |
| 31 BeginFrameArgs::kInvalidFrameNumber), | |
| 32 last_begin_frame_sequence_number_pending_tree_was_fresh_( | |
| 33 BeginFrameArgs::kInvalidFrameNumber), | |
| 34 last_begin_frame_sequence_number_active_tree_was_fresh_( | |
| 35 BeginFrameArgs::kInvalidFrameNumber), | |
| 36 last_begin_frame_sequence_number_compositor_frame_was_fresh_( | |
| 37 BeginFrameArgs::kInvalidFrameNumber), | |
| 27 commit_count_(0), | 38 commit_count_(0), |
| 28 current_frame_number_(0), | 39 current_frame_number_(0), |
| 29 last_frame_number_submit_performed_(-1), | 40 last_frame_number_submit_performed_(-1), |
| 30 last_frame_number_draw_performed_(-1), | 41 last_frame_number_draw_performed_(-1), |
| 31 last_frame_number_begin_main_frame_sent_(-1), | 42 last_frame_number_begin_main_frame_sent_(-1), |
| 32 last_frame_number_invalidate_compositor_frame_sink_performed_(-1), | 43 last_frame_number_invalidate_compositor_frame_sink_performed_(-1), |
| 33 draw_funnel_(false), | 44 draw_funnel_(false), |
| 34 send_begin_main_frame_funnel_(true), | 45 send_begin_main_frame_funnel_(true), |
| 35 invalidate_compositor_frame_sink_funnel_(false), | 46 invalidate_compositor_frame_sink_funnel_(false), |
| 36 prepare_tiles_funnel_(0), | 47 prepare_tiles_funnel_(0), |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 207 | 218 |
| 208 state->BeginDictionary("minor_state"); | 219 state->BeginDictionary("minor_state"); |
| 209 state->SetInteger("commit_count", commit_count_); | 220 state->SetInteger("commit_count", commit_count_); |
| 210 state->SetInteger("current_frame_number", current_frame_number_); | 221 state->SetInteger("current_frame_number", current_frame_number_); |
| 211 state->SetInteger("last_frame_number_submit_performed", | 222 state->SetInteger("last_frame_number_submit_performed", |
| 212 last_frame_number_submit_performed_); | 223 last_frame_number_submit_performed_); |
| 213 state->SetInteger("last_frame_number_draw_performed", | 224 state->SetInteger("last_frame_number_draw_performed", |
| 214 last_frame_number_draw_performed_); | 225 last_frame_number_draw_performed_); |
| 215 state->SetInteger("last_frame_number_begin_main_frame_sent", | 226 state->SetInteger("last_frame_number_begin_main_frame_sent", |
| 216 last_frame_number_begin_main_frame_sent_); | 227 last_frame_number_begin_main_frame_sent_); |
| 228 state->SetInteger("begin_frame_source_id", begin_frame_source_id_); | |
| 229 state->SetInteger("begin_frame_sequence_number", | |
| 230 begin_frame_sequence_number_); | |
| 231 state->SetInteger("last_begin_frame_sequence_number_begin_main_frame_sent", | |
| 232 last_begin_frame_sequence_number_begin_main_frame_sent_); | |
| 233 state->SetInteger("last_begin_frame_sequence_number_pending_tree_was_fresh", | |
| 234 last_begin_frame_sequence_number_pending_tree_was_fresh_); | |
| 235 state->SetInteger("last_begin_frame_sequence_number_active_tree_was_fresh", | |
| 236 last_begin_frame_sequence_number_active_tree_was_fresh_); | |
| 237 state->SetInteger( | |
| 238 "last_begin_frame_sequence_number_compositor_frame_was_fresh", | |
| 239 last_begin_frame_sequence_number_compositor_frame_was_fresh_); | |
| 217 state->SetBoolean("funnel: draw_funnel", draw_funnel_); | 240 state->SetBoolean("funnel: draw_funnel", draw_funnel_); |
| 218 state->SetBoolean("funnel: send_begin_main_frame_funnel", | 241 state->SetBoolean("funnel: send_begin_main_frame_funnel", |
| 219 send_begin_main_frame_funnel_); | 242 send_begin_main_frame_funnel_); |
| 220 state->SetInteger("funnel: prepare_tiles_funnel", prepare_tiles_funnel_); | 243 state->SetInteger("funnel: prepare_tiles_funnel", prepare_tiles_funnel_); |
| 221 state->SetBoolean("funnel: invalidate_compositor_frame_sink_funnel", | 244 state->SetBoolean("funnel: invalidate_compositor_frame_sink_funnel", |
| 222 invalidate_compositor_frame_sink_funnel_); | 245 invalidate_compositor_frame_sink_funnel_); |
| 223 state->SetInteger("consecutive_checkerboard_animations", | 246 state->SetInteger("consecutive_checkerboard_animations", |
| 224 consecutive_checkerboard_animations_); | 247 consecutive_checkerboard_animations_); |
| 225 state->SetInteger("pending_submit_frames_", pending_submit_frames_); | 248 state->SetInteger("pending_submit_frames_", pending_submit_frames_); |
| 226 state->SetInteger("submit_frames_with_current_compositor_frame_sink", | 249 state->SetInteger("submit_frames_with_current_compositor_frame_sink", |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 567 | 590 |
| 568 void SchedulerStateMachine::WillSendBeginMainFrame() { | 591 void SchedulerStateMachine::WillSendBeginMainFrame() { |
| 569 DCHECK(!has_pending_tree_ || settings_.main_frame_before_activation_enabled); | 592 DCHECK(!has_pending_tree_ || settings_.main_frame_before_activation_enabled); |
| 570 DCHECK(visible_); | 593 DCHECK(visible_); |
| 571 DCHECK(!begin_frame_source_paused_); | 594 DCHECK(!begin_frame_source_paused_); |
| 572 DCHECK(!send_begin_main_frame_funnel_); | 595 DCHECK(!send_begin_main_frame_funnel_); |
| 573 begin_main_frame_state_ = BEGIN_MAIN_FRAME_STATE_SENT; | 596 begin_main_frame_state_ = BEGIN_MAIN_FRAME_STATE_SENT; |
| 574 needs_begin_main_frame_ = false; | 597 needs_begin_main_frame_ = false; |
| 575 send_begin_main_frame_funnel_ = true; | 598 send_begin_main_frame_funnel_ = true; |
| 576 last_frame_number_begin_main_frame_sent_ = current_frame_number_; | 599 last_frame_number_begin_main_frame_sent_ = current_frame_number_; |
| 600 last_begin_frame_sequence_number_begin_main_frame_sent_ = | |
| 601 begin_frame_sequence_number_; | |
| 577 } | 602 } |
| 578 | 603 |
| 579 void SchedulerStateMachine::WillCommit(bool commit_has_no_updates) { | 604 void SchedulerStateMachine::WillCommit(bool commit_has_no_updates) { |
| 580 DCHECK(!has_pending_tree_ || | 605 DCHECK(!has_pending_tree_ || |
| 581 (settings_.main_frame_before_activation_enabled && | 606 (settings_.main_frame_before_activation_enabled && |
| 582 commit_has_no_updates)); | 607 commit_has_no_updates)); |
| 583 commit_count_++; | 608 commit_count_++; |
| 584 last_commit_had_no_updates_ = commit_has_no_updates; | 609 last_commit_had_no_updates_ = commit_has_no_updates; |
| 585 begin_main_frame_state_ = BEGIN_MAIN_FRAME_STATE_IDLE; | 610 begin_main_frame_state_ = BEGIN_MAIN_FRAME_STATE_IDLE; |
| 586 | 611 |
| 587 if (!commit_has_no_updates) { | 612 if (commit_has_no_updates) { |
| 588 // Pending tree only exists if commit had updates. | 613 // Pending tree might still exist from prior commit. |
| 614 if (has_pending_tree_) { | |
| 615 DCHECK(settings_.main_frame_before_activation_enabled); | |
| 616 last_begin_frame_sequence_number_pending_tree_was_fresh_ = | |
| 617 last_begin_frame_sequence_number_begin_main_frame_sent_; | |
| 618 } else { | |
| 619 if (last_begin_frame_sequence_number_compositor_frame_was_fresh_ == | |
| 620 last_begin_frame_sequence_number_active_tree_was_fresh_) { | |
| 621 // Assuming that SetNeedsRedraw() is only called at the beginning of | |
| 622 // a BeginFrame, we can update the compositor frame freshness. | |
| 623 last_begin_frame_sequence_number_compositor_frame_was_fresh_ = | |
| 624 last_begin_frame_sequence_number_begin_main_frame_sent_; | |
| 625 } | |
| 626 last_begin_frame_sequence_number_active_tree_was_fresh_ = | |
| 627 last_begin_frame_sequence_number_begin_main_frame_sent_; | |
| 628 } | |
| 629 } else { | |
| 630 // We have a new pending tree. | |
| 589 has_pending_tree_ = true; | 631 has_pending_tree_ = true; |
| 590 pending_tree_is_ready_for_activation_ = false; | 632 pending_tree_is_ready_for_activation_ = false; |
| 633 last_begin_frame_sequence_number_pending_tree_was_fresh_ = | |
| 634 last_begin_frame_sequence_number_begin_main_frame_sent_; | |
| 591 wait_for_ready_to_draw_ = settings_.commit_to_active_tree; | 635 wait_for_ready_to_draw_ = settings_.commit_to_active_tree; |
| 592 } | 636 } |
| 593 | 637 |
| 594 // Update state related to forced draws. | 638 // Update state related to forced draws. |
| 595 if (forced_redraw_state_ == FORCED_REDRAW_STATE_WAITING_FOR_COMMIT) { | 639 if (forced_redraw_state_ == FORCED_REDRAW_STATE_WAITING_FOR_COMMIT) { |
| 596 forced_redraw_state_ = has_pending_tree_ | 640 forced_redraw_state_ = has_pending_tree_ |
| 597 ? FORCED_REDRAW_STATE_WAITING_FOR_ACTIVATION | 641 ? FORCED_REDRAW_STATE_WAITING_FOR_ACTIVATION |
| 598 : FORCED_REDRAW_STATE_WAITING_FOR_DRAW; | 642 : FORCED_REDRAW_STATE_WAITING_FOR_DRAW; |
| 599 } | 643 } |
| 600 | 644 |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 612 COMPOSITOR_FRAME_SINK_WAITING_FOR_FIRST_ACTIVATION) | 656 COMPOSITOR_FRAME_SINK_WAITING_FOR_FIRST_ACTIVATION) |
| 613 compositor_frame_sink_state_ = COMPOSITOR_FRAME_SINK_ACTIVE; | 657 compositor_frame_sink_state_ = COMPOSITOR_FRAME_SINK_ACTIVE; |
| 614 | 658 |
| 615 if (forced_redraw_state_ == FORCED_REDRAW_STATE_WAITING_FOR_ACTIVATION) | 659 if (forced_redraw_state_ == FORCED_REDRAW_STATE_WAITING_FOR_ACTIVATION) |
| 616 forced_redraw_state_ = FORCED_REDRAW_STATE_WAITING_FOR_DRAW; | 660 forced_redraw_state_ = FORCED_REDRAW_STATE_WAITING_FOR_DRAW; |
| 617 | 661 |
| 618 has_pending_tree_ = false; | 662 has_pending_tree_ = false; |
| 619 pending_tree_is_ready_for_activation_ = false; | 663 pending_tree_is_ready_for_activation_ = false; |
| 620 active_tree_needs_first_draw_ = true; | 664 active_tree_needs_first_draw_ = true; |
| 621 needs_redraw_ = true; | 665 needs_redraw_ = true; |
| 666 last_begin_frame_sequence_number_active_tree_was_fresh_ = | |
| 667 last_begin_frame_sequence_number_pending_tree_was_fresh_; | |
| 622 } | 668 } |
| 623 | 669 |
| 624 void SchedulerStateMachine::WillDrawInternal() { | 670 void SchedulerStateMachine::WillDrawInternal() { |
| 625 // If a new active tree is pending after the one we are about to draw, | 671 // If a new active tree is pending after the one we are about to draw, |
| 626 // the main thread is in a high latency mode. | 672 // the main thread is in a high latency mode. |
| 627 // main_thread_missed_last_deadline_ is here in addition to | 673 // main_thread_missed_last_deadline_ is here in addition to |
| 628 // OnBeginImplFrameIdle for cases where the scheduler aborts draws outside | 674 // OnBeginImplFrameIdle for cases where the scheduler aborts draws outside |
| 629 // of the deadline. | 675 // of the deadline. |
| 630 main_thread_missed_last_deadline_ = CommitPending() || has_pending_tree_; | 676 main_thread_missed_last_deadline_ = CommitPending() || has_pending_tree_; |
| 631 | 677 |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 646 switch (draw_result) { | 692 switch (draw_result) { |
| 647 case INVALID_RESULT: | 693 case INVALID_RESULT: |
| 648 case DRAW_ABORTED_CANT_DRAW: | 694 case DRAW_ABORTED_CANT_DRAW: |
| 649 case DRAW_ABORTED_CONTEXT_LOST: | 695 case DRAW_ABORTED_CONTEXT_LOST: |
| 650 NOTREACHED() << "Invalid return DrawResult:" << draw_result; | 696 NOTREACHED() << "Invalid return DrawResult:" << draw_result; |
| 651 break; | 697 break; |
| 652 case DRAW_ABORTED_DRAINING_PIPELINE: | 698 case DRAW_ABORTED_DRAINING_PIPELINE: |
| 653 case DRAW_SUCCESS: | 699 case DRAW_SUCCESS: |
| 654 consecutive_checkerboard_animations_ = 0; | 700 consecutive_checkerboard_animations_ = 0; |
| 655 forced_redraw_state_ = FORCED_REDRAW_STATE_IDLE; | 701 forced_redraw_state_ = FORCED_REDRAW_STATE_IDLE; |
| 702 // The draw either didn't have damage or had damage and submitted a | |
|
Eric Seckler
2017/02/17 00:07:27
To cover successful draws with and without damages
brianderson
2017/02/22 23:27:05
Glad we found that!
| |
| 703 // CompositorFrame. In either case, the compositor frame freshness should | |
| 704 // be updated to match the active tree. | |
| 705 last_begin_frame_sequence_number_compositor_frame_was_fresh_ = | |
| 706 last_begin_frame_sequence_number_active_tree_was_fresh_; | |
| 656 break; | 707 break; |
| 657 case DRAW_ABORTED_CHECKERBOARD_ANIMATIONS: | 708 case DRAW_ABORTED_CHECKERBOARD_ANIMATIONS: |
| 658 DCHECK(!did_submit_in_last_frame_); | 709 DCHECK(!did_submit_in_last_frame_); |
| 659 needs_begin_main_frame_ = true; | 710 needs_begin_main_frame_ = true; |
| 660 needs_redraw_ = true; | 711 needs_redraw_ = true; |
| 661 consecutive_checkerboard_animations_++; | 712 consecutive_checkerboard_animations_++; |
| 662 | 713 |
| 663 if (consecutive_checkerboard_animations_ >= | 714 if (consecutive_checkerboard_animations_ >= |
| 664 settings_.maximum_number_of_failed_draws_before_draw_is_forced && | 715 settings_.maximum_number_of_failed_draws_before_draw_is_forced && |
| 665 forced_redraw_state_ == FORCED_REDRAW_STATE_IDLE && | 716 forced_redraw_state_ == FORCED_REDRAW_STATE_IDLE && |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 808 return true; | 859 return true; |
| 809 | 860 |
| 810 // If the last commit was aborted because of early out (no updates), we should | 861 // If the last commit was aborted because of early out (no updates), we should |
| 811 // still want a begin frame in case there is a commit coming again. | 862 // still want a begin frame in case there is a commit coming again. |
| 812 if (last_commit_had_no_updates_) | 863 if (last_commit_had_no_updates_) |
| 813 return true; | 864 return true; |
| 814 | 865 |
| 815 return false; | 866 return false; |
| 816 } | 867 } |
| 817 | 868 |
| 818 void SchedulerStateMachine::OnBeginImplFrame() { | 869 void SchedulerStateMachine::OnBeginFrameDroppedNotObserving( |
| 870 uint32_t source_id, | |
| 871 uint64_t sequence_number) { | |
| 872 DCHECK(!BeginFrameNeeded()); | |
| 873 DCHECK_EQ(BEGIN_IMPL_FRAME_STATE_IDLE, begin_impl_frame_state_); | |
| 874 | |
| 875 // Confirms the dropped BeginFrame, since we don't have updates. | |
| 876 UpdateBeginFrameSequenceNumbersForBeginFrame(source_id, sequence_number); | |
| 877 UpdateBeginFrameSequenceNumbersForBeginFrameDeadline(); | |
| 878 } | |
| 879 | |
| 880 void SchedulerStateMachine::UpdateBeginFrameSequenceNumbersForBeginFrame( | |
| 881 uint32_t source_id, | |
| 882 uint64_t sequence_number) { | |
| 883 if (source_id != begin_frame_source_id_) { | |
| 884 begin_frame_source_id_ = source_id; | |
| 885 begin_frame_sequence_number_ = sequence_number; | |
| 886 | |
| 887 // Reset freshness sequence numbers. | |
| 888 last_begin_frame_sequence_number_begin_main_frame_sent_ = | |
| 889 BeginFrameArgs::kInvalidFrameNumber; | |
| 890 last_begin_frame_sequence_number_active_tree_was_fresh_ = | |
| 891 BeginFrameArgs::kInvalidFrameNumber; | |
| 892 last_begin_frame_sequence_number_pending_tree_was_fresh_ = | |
| 893 BeginFrameArgs::kInvalidFrameNumber; | |
| 894 last_begin_frame_sequence_number_compositor_frame_was_fresh_ = | |
| 895 BeginFrameArgs::kInvalidFrameNumber; | |
| 896 } else { | |
| 897 DCHECK_GT(sequence_number, begin_frame_sequence_number_); | |
| 898 begin_frame_sequence_number_ = sequence_number; | |
| 899 } | |
| 900 } | |
| 901 | |
| 902 void SchedulerStateMachine:: | |
| 903 UpdateBeginFrameSequenceNumbersForBeginFrameDeadline() { | |
| 904 // Update frame numbers for freshness in case no updates were necessary. | |
| 905 if (begin_main_frame_state_ != BEGIN_MAIN_FRAME_STATE_IDLE || | |
| 906 needs_begin_main_frame_) { | |
| 907 return; | |
| 908 } | |
| 909 | |
| 910 if (has_pending_tree_) { | |
| 911 last_begin_frame_sequence_number_pending_tree_was_fresh_ = | |
| 912 begin_frame_sequence_number_; | |
| 913 return; | |
| 914 } | |
| 915 | |
| 916 last_begin_frame_sequence_number_active_tree_was_fresh_ = | |
| 917 begin_frame_sequence_number_; | |
| 918 | |
| 919 if (!needs_redraw_) | |
|
brianderson
2017/02/22 23:27:05
{}
| |
| 920 last_begin_frame_sequence_number_compositor_frame_was_fresh_ = | |
| 921 begin_frame_sequence_number_; | |
| 922 } | |
| 923 | |
| 924 void SchedulerStateMachine::OnBeginImplFrame(uint32_t source_id, | |
| 925 uint64_t sequence_number) { | |
| 926 UpdateBeginFrameSequenceNumbersForBeginFrame(source_id, sequence_number); | |
| 927 | |
| 819 begin_impl_frame_state_ = BEGIN_IMPL_FRAME_STATE_INSIDE_BEGIN_FRAME; | 928 begin_impl_frame_state_ = BEGIN_IMPL_FRAME_STATE_INSIDE_BEGIN_FRAME; |
| 820 current_frame_number_++; | 929 current_frame_number_++; |
| 821 | 930 |
| 822 last_commit_had_no_updates_ = false; | 931 last_commit_had_no_updates_ = false; |
| 823 did_draw_in_last_frame_ = false; | 932 did_draw_in_last_frame_ = false; |
| 824 did_submit_in_last_frame_ = false; | 933 did_submit_in_last_frame_ = false; |
| 825 needs_one_begin_impl_frame_ = false; | 934 needs_one_begin_impl_frame_ = false; |
| 826 | 935 |
| 827 // Clear funnels for any actions we perform during the frame. | 936 // Clear funnels for any actions we perform during the frame. |
| 828 send_begin_main_frame_funnel_ = false; | 937 send_begin_main_frame_funnel_ = false; |
| 829 invalidate_compositor_frame_sink_funnel_ = false; | 938 invalidate_compositor_frame_sink_funnel_ = false; |
| 830 | 939 |
| 831 // "Drain" the PrepareTiles funnel. | 940 // "Drain" the PrepareTiles funnel. |
| 832 if (prepare_tiles_funnel_ > 0) | 941 if (prepare_tiles_funnel_ > 0) |
| 833 prepare_tiles_funnel_--; | 942 prepare_tiles_funnel_--; |
| 834 } | 943 } |
| 835 | 944 |
| 836 void SchedulerStateMachine::OnBeginImplFrameDeadline() { | 945 void SchedulerStateMachine::OnBeginImplFrameDeadline() { |
| 837 begin_impl_frame_state_ = BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE; | 946 begin_impl_frame_state_ = BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE; |
| 838 | 947 |
| 839 // Clear funnels for any actions we perform during the deadline. | 948 // Clear funnels for any actions we perform during the deadline. |
| 840 draw_funnel_ = false; | 949 draw_funnel_ = false; |
| 841 | 950 |
| 842 // Allow one PrepareTiles per draw for synchronous compositor. | 951 // Allow one PrepareTiles per draw for synchronous compositor. |
| 843 if (settings_.using_synchronous_renderer_compositor) { | 952 if (settings_.using_synchronous_renderer_compositor) { |
| 844 if (prepare_tiles_funnel_ > 0) | 953 if (prepare_tiles_funnel_ > 0) |
| 845 prepare_tiles_funnel_--; | 954 prepare_tiles_funnel_--; |
| 846 } | 955 } |
| 956 | |
| 957 UpdateBeginFrameSequenceNumbersForBeginFrameDeadline(); | |
| 847 } | 958 } |
| 848 | 959 |
| 849 void SchedulerStateMachine::OnBeginImplFrameIdle() { | 960 void SchedulerStateMachine::OnBeginImplFrameIdle() { |
| 850 begin_impl_frame_state_ = BEGIN_IMPL_FRAME_STATE_IDLE; | 961 begin_impl_frame_state_ = BEGIN_IMPL_FRAME_STATE_IDLE; |
| 851 | 962 |
| 852 skip_next_begin_main_frame_to_reduce_latency_ = false; | 963 skip_next_begin_main_frame_to_reduce_latency_ = false; |
| 853 | 964 |
| 854 // If a new or undrawn active tree is pending after the deadline, | 965 // If a new or undrawn active tree is pending after the deadline, |
| 855 // then the main thread is in a high latency mode. | 966 // then the main thread is in a high latency mode. |
| 856 main_thread_missed_last_deadline_ = | 967 main_thread_missed_last_deadline_ = |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1103 case COMPOSITOR_FRAME_SINK_ACTIVE: | 1214 case COMPOSITOR_FRAME_SINK_ACTIVE: |
| 1104 case COMPOSITOR_FRAME_SINK_WAITING_FOR_FIRST_COMMIT: | 1215 case COMPOSITOR_FRAME_SINK_WAITING_FOR_FIRST_COMMIT: |
| 1105 case COMPOSITOR_FRAME_SINK_WAITING_FOR_FIRST_ACTIVATION: | 1216 case COMPOSITOR_FRAME_SINK_WAITING_FOR_FIRST_ACTIVATION: |
| 1106 return true; | 1217 return true; |
| 1107 } | 1218 } |
| 1108 NOTREACHED(); | 1219 NOTREACHED(); |
| 1109 return false; | 1220 return false; |
| 1110 } | 1221 } |
| 1111 | 1222 |
| 1112 } // namespace cc | 1223 } // namespace cc |
| OLD | NEW |