Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(174)

Side by Side Diff: cc/scheduler/scheduler_state_machine.cc

Issue 1984453003: cc: Do not reset pending tree state incorrectly on aborted commits. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | cc/scheduler/scheduler_state_machine_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 DCHECK(visible_); 571 DCHECK(visible_);
572 DCHECK(!begin_frame_source_paused_); 572 DCHECK(!begin_frame_source_paused_);
573 DCHECK(!send_begin_main_frame_funnel_); 573 DCHECK(!send_begin_main_frame_funnel_);
574 begin_main_frame_state_ = BEGIN_MAIN_FRAME_STATE_SENT; 574 begin_main_frame_state_ = BEGIN_MAIN_FRAME_STATE_SENT;
575 needs_begin_main_frame_ = false; 575 needs_begin_main_frame_ = false;
576 send_begin_main_frame_funnel_ = true; 576 send_begin_main_frame_funnel_ = true;
577 last_frame_number_begin_main_frame_sent_ = current_frame_number_; 577 last_frame_number_begin_main_frame_sent_ = current_frame_number_;
578 } 578 }
579 579
580 void SchedulerStateMachine::WillCommit(bool commit_has_no_updates) { 580 void SchedulerStateMachine::WillCommit(bool commit_has_no_updates) {
581 DCHECK(!has_pending_tree_ ||
582 (settings_.main_frame_before_activation_enabled &&
583 commit_has_no_updates));
581 commit_count_++; 584 commit_count_++;
582 585
583 if (commit_has_no_updates || settings_.main_frame_before_activation_enabled) { 586 if (commit_has_no_updates || settings_.main_frame_before_activation_enabled) {
584 begin_main_frame_state_ = BEGIN_MAIN_FRAME_STATE_IDLE; 587 begin_main_frame_state_ = BEGIN_MAIN_FRAME_STATE_IDLE;
585 } else { 588 } else {
586 begin_main_frame_state_ = BEGIN_MAIN_FRAME_STATE_WAITING_FOR_ACTIVATION; 589 begin_main_frame_state_ = BEGIN_MAIN_FRAME_STATE_WAITING_FOR_ACTIVATION;
587 } 590 }
588 591
589 // If the commit was aborted, then there is no pending tree. 592 // If the commit was aborted, then there is no pending tree.
enne (OOO) 2016/05/16 17:05:41 I don't think this comment is true any longer.
sunnyps 2016/05/16 19:54:22 Done.
590 has_pending_tree_ = !commit_has_no_updates; 593 if (!commit_has_no_updates)
594 has_pending_tree_ = true;
591 595
592 wait_for_ready_to_draw_ = 596 wait_for_ready_to_draw_ =
593 !commit_has_no_updates && settings_.commit_to_active_tree; 597 !commit_has_no_updates && settings_.commit_to_active_tree;
594 598
595 // Update state related to forced draws. 599 // Update state related to forced draws.
596 if (forced_redraw_state_ == FORCED_REDRAW_STATE_WAITING_FOR_COMMIT) { 600 if (forced_redraw_state_ == FORCED_REDRAW_STATE_WAITING_FOR_COMMIT) {
597 forced_redraw_state_ = has_pending_tree_ 601 forced_redraw_state_ = has_pending_tree_
598 ? FORCED_REDRAW_STATE_WAITING_FOR_ACTIVATION 602 ? FORCED_REDRAW_STATE_WAITING_FOR_ACTIVATION
599 : FORCED_REDRAW_STATE_WAITING_FOR_DRAW; 603 : FORCED_REDRAW_STATE_WAITING_FOR_DRAW;
600 } 604 }
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
1135 case OUTPUT_SURFACE_ACTIVE: 1139 case OUTPUT_SURFACE_ACTIVE:
1136 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT: 1140 case OUTPUT_SURFACE_WAITING_FOR_FIRST_COMMIT:
1137 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION: 1141 case OUTPUT_SURFACE_WAITING_FOR_FIRST_ACTIVATION:
1138 return true; 1142 return true;
1139 } 1143 }
1140 NOTREACHED(); 1144 NOTREACHED();
1141 return false; 1145 return false;
1142 } 1146 }
1143 1147
1144 } // namespace cc 1148 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/scheduler/scheduler_state_machine_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698