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/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/debug/trace_event_argument.h" | 8 #include "base/debug/trace_event_argument.h" |
9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
12 #include "base/values.h" | 12 #include "base/values.h" |
13 #include "ui/gfx/frame_time.h" | 13 #include "ui/gfx/frame_time.h" |
14 | 14 |
15 namespace cc { | 15 namespace cc { |
16 | 16 |
17 SchedulerStateMachine::SchedulerStateMachine(const SchedulerSettings& settings) | 17 SchedulerStateMachine::SchedulerStateMachine(const SchedulerSettings& settings) |
18 : settings_(settings), | 18 : settings_(settings), |
19 output_surface_state_(OUTPUT_SURFACE_LOST), | 19 output_surface_state_(OUTPUT_SURFACE_LOST), |
20 begin_impl_frame_state_(BEGIN_IMPL_FRAME_STATE_IDLE), | 20 begin_impl_frame_state_(BEGIN_IMPL_FRAME_STATE_IDLE), |
21 commit_state_(COMMIT_STATE_IDLE), | 21 commit_state_(COMMIT_STATE_IDLE), |
22 forced_redraw_state_(FORCED_REDRAW_STATE_IDLE), | 22 forced_redraw_state_(FORCED_REDRAW_STATE_IDLE), |
23 commit_count_(0), | 23 commit_count_(0), |
24 current_frame_number_(0), | 24 current_frame_number_(0), |
25 last_frame_number_animate_performed_(-1), | 25 last_frame_number_animate_performed_(-1), |
26 last_frame_number_swap_performed_(-1), | 26 last_frame_number_swap_performed_(-1), |
27 last_frame_number_swap_requested_(-1), | 27 last_frame_number_swap_requested_(-1), |
28 last_frame_number_begin_main_frame_sent_(-1), | 28 last_frame_number_begin_main_frame_sent_(-1), |
29 manage_tiles_funnel_(0), | 29 prepare_tiles_funnel_(0), |
30 consecutive_checkerboard_animations_(0), | 30 consecutive_checkerboard_animations_(0), |
31 max_pending_swaps_(1), | 31 max_pending_swaps_(1), |
32 pending_swaps_(0), | 32 pending_swaps_(0), |
33 needs_redraw_(false), | 33 needs_redraw_(false), |
34 needs_animate_(false), | 34 needs_animate_(false), |
35 needs_manage_tiles_(false), | 35 needs_prepare_tiles_(false), |
36 needs_commit_(false), | 36 needs_commit_(false), |
37 inside_poll_for_anticipated_draw_triggers_(false), | 37 inside_poll_for_anticipated_draw_triggers_(false), |
38 visible_(false), | 38 visible_(false), |
39 can_start_(false), | 39 can_start_(false), |
40 can_draw_(false), | 40 can_draw_(false), |
41 has_pending_tree_(false), | 41 has_pending_tree_(false), |
42 pending_tree_is_ready_for_activation_(false), | 42 pending_tree_is_ready_for_activation_(false), |
43 active_tree_needs_first_draw_(false), | 43 active_tree_needs_first_draw_(false), |
44 did_commit_after_animating_(false), | 44 did_commit_after_animating_(false), |
45 did_create_and_initialize_first_output_surface_(false), | 45 did_create_and_initialize_first_output_surface_(false), |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 case ACTION_ACTIVATE_SYNC_TREE: | 133 case ACTION_ACTIVATE_SYNC_TREE: |
134 return "ACTION_ACTIVATE_SYNC_TREE"; | 134 return "ACTION_ACTIVATE_SYNC_TREE"; |
135 case ACTION_DRAW_AND_SWAP_IF_POSSIBLE: | 135 case ACTION_DRAW_AND_SWAP_IF_POSSIBLE: |
136 return "ACTION_DRAW_AND_SWAP_IF_POSSIBLE"; | 136 return "ACTION_DRAW_AND_SWAP_IF_POSSIBLE"; |
137 case ACTION_DRAW_AND_SWAP_FORCED: | 137 case ACTION_DRAW_AND_SWAP_FORCED: |
138 return "ACTION_DRAW_AND_SWAP_FORCED"; | 138 return "ACTION_DRAW_AND_SWAP_FORCED"; |
139 case ACTION_DRAW_AND_SWAP_ABORT: | 139 case ACTION_DRAW_AND_SWAP_ABORT: |
140 return "ACTION_DRAW_AND_SWAP_ABORT"; | 140 return "ACTION_DRAW_AND_SWAP_ABORT"; |
141 case ACTION_BEGIN_OUTPUT_SURFACE_CREATION: | 141 case ACTION_BEGIN_OUTPUT_SURFACE_CREATION: |
142 return "ACTION_BEGIN_OUTPUT_SURFACE_CREATION"; | 142 return "ACTION_BEGIN_OUTPUT_SURFACE_CREATION"; |
143 case ACTION_MANAGE_TILES: | 143 case ACTION_PREPARE_TILES: |
144 return "ACTION_MANAGE_TILES"; | 144 return "ACTION_PREPARE_TILES"; |
145 } | 145 } |
146 NOTREACHED(); | 146 NOTREACHED(); |
147 return "???"; | 147 return "???"; |
148 } | 148 } |
149 | 149 |
150 scoped_refptr<base::debug::ConvertableToTraceFormat> | 150 scoped_refptr<base::debug::ConvertableToTraceFormat> |
151 SchedulerStateMachine::AsValue() const { | 151 SchedulerStateMachine::AsValue() const { |
152 scoped_refptr<base::debug::TracedValue> state = | 152 scoped_refptr<base::debug::TracedValue> state = |
153 new base::debug::TracedValue(); | 153 new base::debug::TracedValue(); |
154 AsValueInto(state.get(), gfx::FrameTime::Now()); | 154 AsValueInto(state.get(), gfx::FrameTime::Now()); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 | 199 |
200 state->SetInteger("last_frame_number_animate_performed", | 200 state->SetInteger("last_frame_number_animate_performed", |
201 last_frame_number_animate_performed_); | 201 last_frame_number_animate_performed_); |
202 state->SetInteger("last_frame_number_swap_performed", | 202 state->SetInteger("last_frame_number_swap_performed", |
203 last_frame_number_swap_performed_); | 203 last_frame_number_swap_performed_); |
204 state->SetInteger("last_frame_number_swap_requested", | 204 state->SetInteger("last_frame_number_swap_requested", |
205 last_frame_number_swap_requested_); | 205 last_frame_number_swap_requested_); |
206 state->SetInteger("last_frame_number_begin_main_frame_sent", | 206 state->SetInteger("last_frame_number_begin_main_frame_sent", |
207 last_frame_number_begin_main_frame_sent_); | 207 last_frame_number_begin_main_frame_sent_); |
208 | 208 |
209 state->SetInteger("manage_tiles_funnel", manage_tiles_funnel_); | 209 state->SetInteger("prepare_tiles_funnel", prepare_tiles_funnel_); |
210 state->SetInteger("consecutive_checkerboard_animations", | 210 state->SetInteger("consecutive_checkerboard_animations", |
211 consecutive_checkerboard_animations_); | 211 consecutive_checkerboard_animations_); |
212 state->SetInteger("max_pending_swaps_", max_pending_swaps_); | 212 state->SetInteger("max_pending_swaps_", max_pending_swaps_); |
213 state->SetInteger("pending_swaps_", pending_swaps_); | 213 state->SetInteger("pending_swaps_", pending_swaps_); |
214 state->SetBoolean("needs_redraw", needs_redraw_); | 214 state->SetBoolean("needs_redraw", needs_redraw_); |
215 state->SetBoolean("needs_animate_", needs_animate_); | 215 state->SetBoolean("needs_animate_", needs_animate_); |
216 state->SetBoolean("needs_manage_tiles", needs_manage_tiles_); | 216 state->SetBoolean("needs_prepare_tiles", needs_prepare_tiles_); |
217 state->SetBoolean("needs_commit", needs_commit_); | 217 state->SetBoolean("needs_commit", needs_commit_); |
218 state->SetBoolean("visible", visible_); | 218 state->SetBoolean("visible", visible_); |
219 state->SetBoolean("can_start", can_start_); | 219 state->SetBoolean("can_start", can_start_); |
220 state->SetBoolean("can_draw", can_draw_); | 220 state->SetBoolean("can_draw", can_draw_); |
221 state->SetBoolean("has_pending_tree", has_pending_tree_); | 221 state->SetBoolean("has_pending_tree", has_pending_tree_); |
222 state->SetBoolean("pending_tree_is_ready_for_activation", | 222 state->SetBoolean("pending_tree_is_ready_for_activation", |
223 pending_tree_is_ready_for_activation_); | 223 pending_tree_is_ready_for_activation_); |
224 state->SetBoolean("active_tree_needs_first_draw", | 224 state->SetBoolean("active_tree_needs_first_draw", |
225 active_tree_needs_first_draw_); | 225 active_tree_needs_first_draw_); |
226 state->SetBoolean("did_commit_after_animating", did_commit_after_animating_); | 226 state->SetBoolean("did_commit_after_animating", did_commit_after_animating_); |
(...skipping 10 matching lines...) Expand all Loading... |
237 state->SetBoolean("continuous_painting", continuous_painting_); | 237 state->SetBoolean("continuous_painting", continuous_painting_); |
238 state->SetBoolean("impl_latency_takes_priority_on_battery", | 238 state->SetBoolean("impl_latency_takes_priority_on_battery", |
239 impl_latency_takes_priority_on_battery_); | 239 impl_latency_takes_priority_on_battery_); |
240 state->SetBoolean("children_need_begin_frames", children_need_begin_frames_); | 240 state->SetBoolean("children_need_begin_frames", children_need_begin_frames_); |
241 state->EndDictionary(); | 241 state->EndDictionary(); |
242 } | 242 } |
243 | 243 |
244 void SchedulerStateMachine::AdvanceCurrentFrameNumber() { | 244 void SchedulerStateMachine::AdvanceCurrentFrameNumber() { |
245 current_frame_number_++; | 245 current_frame_number_++; |
246 | 246 |
247 // "Drain" the ManageTiles funnel. | 247 // "Drain" the PrepareTiles funnel. |
248 if (manage_tiles_funnel_ > 0) | 248 if (prepare_tiles_funnel_ > 0) |
249 manage_tiles_funnel_--; | 249 prepare_tiles_funnel_--; |
250 | 250 |
251 skip_begin_main_frame_to_reduce_latency_ = | 251 skip_begin_main_frame_to_reduce_latency_ = |
252 skip_next_begin_main_frame_to_reduce_latency_; | 252 skip_next_begin_main_frame_to_reduce_latency_; |
253 skip_next_begin_main_frame_to_reduce_latency_ = false; | 253 skip_next_begin_main_frame_to_reduce_latency_ = false; |
254 } | 254 } |
255 | 255 |
256 bool SchedulerStateMachine::HasAnimatedThisFrame() const { | 256 bool SchedulerStateMachine::HasAnimatedThisFrame() const { |
257 return last_frame_number_animate_performed_ == current_frame_number_; | 257 return last_frame_number_animate_performed_ == current_frame_number_; |
258 } | 258 } |
259 | 259 |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 return false; | 474 return false; |
475 } | 475 } |
476 | 476 |
477 // Prioritize drawing the previous commit before finishing the next commit. | 477 // Prioritize drawing the previous commit before finishing the next commit. |
478 if (active_tree_needs_first_draw_) | 478 if (active_tree_needs_first_draw_) |
479 return false; | 479 return false; |
480 | 480 |
481 return true; | 481 return true; |
482 } | 482 } |
483 | 483 |
484 bool SchedulerStateMachine::ShouldManageTiles() const { | 484 bool SchedulerStateMachine::ShouldPrepareTiles() const { |
485 // ManageTiles only really needs to be called immediately after commit | 485 // PrepareTiles only really needs to be called immediately after commit |
486 // and then periodically after that. Use a funnel to make sure we average | 486 // and then periodically after that. Use a funnel to make sure we average |
487 // one ManageTiles per BeginImplFrame in the long run. | 487 // one PrepareTiles per BeginImplFrame in the long run. |
488 if (manage_tiles_funnel_ > 0) | 488 if (prepare_tiles_funnel_ > 0) |
489 return false; | 489 return false; |
490 | 490 |
491 // Limiting to once per-frame is not enough, since we only want to | 491 // Limiting to once per-frame is not enough, since we only want to |
492 // manage tiles _after_ draws. Polling for draw triggers and | 492 // prepare tiles _after_ draws. Polling for draw triggers and |
493 // begin-frame are mutually exclusive, so we limit to these two cases. | 493 // begin-frame are mutually exclusive, so we limit to these two cases. |
494 if (begin_impl_frame_state_ != BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE && | 494 if (begin_impl_frame_state_ != BEGIN_IMPL_FRAME_STATE_INSIDE_DEADLINE && |
495 !inside_poll_for_anticipated_draw_triggers_) | 495 !inside_poll_for_anticipated_draw_triggers_) |
496 return false; | 496 return false; |
497 return needs_manage_tiles_; | 497 return needs_prepare_tiles_; |
498 } | 498 } |
499 | 499 |
500 SchedulerStateMachine::Action SchedulerStateMachine::NextAction() const { | 500 SchedulerStateMachine::Action SchedulerStateMachine::NextAction() const { |
501 if (ShouldActivatePendingTree()) | 501 if (ShouldActivatePendingTree()) |
502 return ACTION_ACTIVATE_SYNC_TREE; | 502 return ACTION_ACTIVATE_SYNC_TREE; |
503 if (ShouldCommit()) | 503 if (ShouldCommit()) |
504 return ACTION_COMMIT; | 504 return ACTION_COMMIT; |
505 if (ShouldAnimate()) | 505 if (ShouldAnimate()) |
506 return ACTION_ANIMATE; | 506 return ACTION_ANIMATE; |
507 if (ShouldDraw()) { | 507 if (ShouldDraw()) { |
508 if (PendingDrawsShouldBeAborted()) | 508 if (PendingDrawsShouldBeAborted()) |
509 return ACTION_DRAW_AND_SWAP_ABORT; | 509 return ACTION_DRAW_AND_SWAP_ABORT; |
510 else if (forced_redraw_state_ == FORCED_REDRAW_STATE_WAITING_FOR_DRAW) | 510 else if (forced_redraw_state_ == FORCED_REDRAW_STATE_WAITING_FOR_DRAW) |
511 return ACTION_DRAW_AND_SWAP_FORCED; | 511 return ACTION_DRAW_AND_SWAP_FORCED; |
512 else | 512 else |
513 return ACTION_DRAW_AND_SWAP_IF_POSSIBLE; | 513 return ACTION_DRAW_AND_SWAP_IF_POSSIBLE; |
514 } | 514 } |
515 if (ShouldManageTiles()) | 515 if (ShouldPrepareTiles()) |
516 return ACTION_MANAGE_TILES; | 516 return ACTION_PREPARE_TILES; |
517 if (ShouldSendBeginMainFrame()) | 517 if (ShouldSendBeginMainFrame()) |
518 return ACTION_SEND_BEGIN_MAIN_FRAME; | 518 return ACTION_SEND_BEGIN_MAIN_FRAME; |
519 if (ShouldBeginOutputSurfaceCreation()) | 519 if (ShouldBeginOutputSurfaceCreation()) |
520 return ACTION_BEGIN_OUTPUT_SURFACE_CREATION; | 520 return ACTION_BEGIN_OUTPUT_SURFACE_CREATION; |
521 return ACTION_NONE; | 521 return ACTION_NONE; |
522 } | 522 } |
523 | 523 |
524 void SchedulerStateMachine::UpdateState(Action action) { | 524 void SchedulerStateMachine::UpdateState(Action action) { |
525 switch (action) { | 525 switch (action) { |
526 case ACTION_NONE: | 526 case ACTION_NONE: |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 output_surface_state_ = OUTPUT_SURFACE_CREATING; | 573 output_surface_state_ = OUTPUT_SURFACE_CREATING; |
574 | 574 |
575 // The following DCHECKs make sure we are in the proper quiescent state. | 575 // The following DCHECKs make sure we are in the proper quiescent state. |
576 // The pipeline should be flushed entirely before we start output | 576 // The pipeline should be flushed entirely before we start output |
577 // surface creation to avoid complicated corner cases. | 577 // surface creation to avoid complicated corner cases. |
578 DCHECK_EQ(commit_state_, COMMIT_STATE_IDLE); | 578 DCHECK_EQ(commit_state_, COMMIT_STATE_IDLE); |
579 DCHECK(!has_pending_tree_); | 579 DCHECK(!has_pending_tree_); |
580 DCHECK(!active_tree_needs_first_draw_); | 580 DCHECK(!active_tree_needs_first_draw_); |
581 return; | 581 return; |
582 | 582 |
583 case ACTION_MANAGE_TILES: | 583 case ACTION_PREPARE_TILES: |
584 UpdateStateOnManageTiles(); | 584 UpdateStateOnPrepareTiles(); |
585 return; | 585 return; |
586 } | 586 } |
587 } | 587 } |
588 | 588 |
589 void SchedulerStateMachine::UpdateStateOnCommit(bool commit_was_aborted) { | 589 void SchedulerStateMachine::UpdateStateOnCommit(bool commit_was_aborted) { |
590 commit_count_++; | 590 commit_count_++; |
591 | 591 |
592 if (!commit_was_aborted && HasAnimatedThisFrame()) | 592 if (!commit_was_aborted && HasAnimatedThisFrame()) |
593 did_commit_after_animating_ = true; | 593 did_commit_after_animating_ = true; |
594 | 594 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 if (commit_state_ == COMMIT_STATE_WAITING_FOR_DRAW) | 666 if (commit_state_ == COMMIT_STATE_WAITING_FOR_DRAW) |
667 commit_state_ = COMMIT_STATE_IDLE; | 667 commit_state_ = COMMIT_STATE_IDLE; |
668 | 668 |
669 needs_redraw_ = false; | 669 needs_redraw_ = false; |
670 active_tree_needs_first_draw_ = false; | 670 active_tree_needs_first_draw_ = false; |
671 | 671 |
672 if (did_request_swap) | 672 if (did_request_swap) |
673 last_frame_number_swap_requested_ = current_frame_number_; | 673 last_frame_number_swap_requested_ = current_frame_number_; |
674 } | 674 } |
675 | 675 |
676 void SchedulerStateMachine::UpdateStateOnManageTiles() { | 676 void SchedulerStateMachine::UpdateStateOnPrepareTiles() { |
677 needs_manage_tiles_ = false; | 677 needs_prepare_tiles_ = false; |
678 } | 678 } |
679 | 679 |
680 void SchedulerStateMachine::SetSkipNextBeginMainFrameToReduceLatency() { | 680 void SchedulerStateMachine::SetSkipNextBeginMainFrameToReduceLatency() { |
681 TRACE_EVENT_INSTANT0("cc", | 681 TRACE_EVENT_INSTANT0("cc", |
682 "Scheduler: SkipNextBeginMainFrameToReduceLatency", | 682 "Scheduler: SkipNextBeginMainFrameToReduceLatency", |
683 TRACE_EVENT_SCOPE_THREAD); | 683 TRACE_EVENT_SCOPE_THREAD); |
684 skip_next_begin_main_frame_to_reduce_latency_ = true; | 684 skip_next_begin_main_frame_to_reduce_latency_ = true; |
685 } | 685 } |
686 | 686 |
687 bool SchedulerStateMachine::BeginFrameNeededForChildren() const { | 687 bool SchedulerStateMachine::BeginFrameNeededForChildren() const { |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
772 if (needs_commit_ || commit_state_ != COMMIT_STATE_IDLE) | 772 if (needs_commit_ || commit_state_ != COMMIT_STATE_IDLE) |
773 return true; | 773 return true; |
774 | 774 |
775 // If the pending tree activates quickly, we'll want a BeginImplFrame soon | 775 // If the pending tree activates quickly, we'll want a BeginImplFrame soon |
776 // to draw the new active tree. | 776 // to draw the new active tree. |
777 if (has_pending_tree_) | 777 if (has_pending_tree_) |
778 return true; | 778 return true; |
779 | 779 |
780 // Changing priorities may allow us to activate (given the new priorities), | 780 // Changing priorities may allow us to activate (given the new priorities), |
781 // which may result in a new frame. | 781 // which may result in a new frame. |
782 if (needs_manage_tiles_) | 782 if (needs_prepare_tiles_) |
783 return true; | 783 return true; |
784 | 784 |
785 // If we just sent a swap request, it's likely that we are going to produce | 785 // If we just sent a swap request, it's likely that we are going to produce |
786 // another frame soon. This helps avoid negative glitches in our | 786 // another frame soon. This helps avoid negative glitches in our |
787 // SetNeedsBeginFrame requests, which may propagate to the BeginImplFrame | 787 // SetNeedsBeginFrame requests, which may propagate to the BeginImplFrame |
788 // provider and get sampled at an inopportune time, delaying the next | 788 // provider and get sampled at an inopportune time, delaying the next |
789 // BeginImplFrame. | 789 // BeginImplFrame. |
790 if (HasRequestedSwapThisFrame()) | 790 if (HasRequestedSwapThisFrame()) |
791 return true; | 791 return true; |
792 | 792 |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
932 void SchedulerStateMachine::SetVisible(bool visible) { visible_ = visible; } | 932 void SchedulerStateMachine::SetVisible(bool visible) { visible_ = visible; } |
933 | 933 |
934 void SchedulerStateMachine::SetCanDraw(bool can_draw) { can_draw_ = can_draw; } | 934 void SchedulerStateMachine::SetCanDraw(bool can_draw) { can_draw_ = can_draw; } |
935 | 935 |
936 void SchedulerStateMachine::SetNeedsRedraw() { needs_redraw_ = true; } | 936 void SchedulerStateMachine::SetNeedsRedraw() { needs_redraw_ = true; } |
937 | 937 |
938 void SchedulerStateMachine::SetNeedsAnimate() { | 938 void SchedulerStateMachine::SetNeedsAnimate() { |
939 needs_animate_ = true; | 939 needs_animate_ = true; |
940 } | 940 } |
941 | 941 |
942 void SchedulerStateMachine::SetNeedsManageTiles() { | 942 void SchedulerStateMachine::SetNeedsPrepareTiles() { |
943 if (!needs_manage_tiles_) { | 943 if (!needs_prepare_tiles_) { |
944 TRACE_EVENT0("cc", | 944 TRACE_EVENT0("cc", "SchedulerStateMachine::SetNeedsPrepareTiles"); |
945 "SchedulerStateMachine::SetNeedsManageTiles"); | 945 needs_prepare_tiles_ = true; |
946 needs_manage_tiles_ = true; | |
947 } | 946 } |
948 } | 947 } |
949 | 948 |
950 void SchedulerStateMachine::SetMaxSwapsPending(int max) { | 949 void SchedulerStateMachine::SetMaxSwapsPending(int max) { |
951 max_pending_swaps_ = max; | 950 max_pending_swaps_ = max; |
952 } | 951 } |
953 | 952 |
954 void SchedulerStateMachine::DidSwapBuffers() { | 953 void SchedulerStateMachine::DidSwapBuffers() { |
955 pending_swaps_++; | 954 pending_swaps_++; |
956 DCHECK_LE(pending_swaps_, max_pending_swaps_); | 955 DCHECK_LE(pending_swaps_, max_pending_swaps_); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1030 DCHECK_EQ(commit_state_, COMMIT_STATE_BEGIN_MAIN_FRAME_SENT); | 1029 DCHECK_EQ(commit_state_, COMMIT_STATE_BEGIN_MAIN_FRAME_SENT); |
1031 if (did_handle) { | 1030 if (did_handle) { |
1032 bool commit_was_aborted = true; | 1031 bool commit_was_aborted = true; |
1033 UpdateStateOnCommit(commit_was_aborted); | 1032 UpdateStateOnCommit(commit_was_aborted); |
1034 } else { | 1033 } else { |
1035 commit_state_ = COMMIT_STATE_IDLE; | 1034 commit_state_ = COMMIT_STATE_IDLE; |
1036 SetNeedsCommit(); | 1035 SetNeedsCommit(); |
1037 } | 1036 } |
1038 } | 1037 } |
1039 | 1038 |
1040 void SchedulerStateMachine::DidManageTiles() { | 1039 void SchedulerStateMachine::DidPrepareTiles() { |
1041 needs_manage_tiles_ = false; | 1040 needs_prepare_tiles_ = false; |
1042 // "Fill" the ManageTiles funnel. | 1041 // "Fill" the PrepareTiles funnel. |
1043 manage_tiles_funnel_++; | 1042 prepare_tiles_funnel_++; |
1044 } | 1043 } |
1045 | 1044 |
1046 void SchedulerStateMachine::DidLoseOutputSurface() { | 1045 void SchedulerStateMachine::DidLoseOutputSurface() { |
1047 if (output_surface_state_ == OUTPUT_SURFACE_LOST || | 1046 if (output_surface_state_ == OUTPUT_SURFACE_LOST || |
1048 output_surface_state_ == OUTPUT_SURFACE_CREATING) | 1047 output_surface_state_ == OUTPUT_SURFACE_CREATING) |
1049 return; | 1048 return; |
1050 output_surface_state_ = OUTPUT_SURFACE_LOST; | 1049 output_surface_state_ = OUTPUT_SURFACE_LOST; |
1051 needs_redraw_ = false; | 1050 needs_redraw_ = false; |
1052 } | 1051 } |
1053 | 1052 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1096 static_cast<int>(begin_impl_frame_state_), | 1095 static_cast<int>(begin_impl_frame_state_), |
1097 static_cast<int>(commit_state_), | 1096 static_cast<int>(commit_state_), |
1098 has_pending_tree_ ? 'T' : 'F', | 1097 has_pending_tree_ ? 'T' : 'F', |
1099 pending_tree_is_ready_for_activation_ ? 'T' : 'F', | 1098 pending_tree_is_ready_for_activation_ ? 'T' : 'F', |
1100 active_tree_needs_first_draw_ ? 'T' : 'F', | 1099 active_tree_needs_first_draw_ ? 'T' : 'F', |
1101 max_pending_swaps_, | 1100 max_pending_swaps_, |
1102 pending_swaps_); | 1101 pending_swaps_); |
1103 } | 1102 } |
1104 | 1103 |
1105 } // namespace cc | 1104 } // namespace cc |
OLD | NEW |