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

Side by Side Diff: trunk/src/cc/scheduler/scheduler.cc

Issue 254883004: Revert 266624 "cc: Split animating and drawing into separate act..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « trunk/src/cc/scheduler/scheduler.h ('k') | trunk/src/cc/scheduler/scheduler_state_machine.h » ('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.h" 5 #include "cc/scheduler/scheduler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include "base/auto_reset.h" 8 #include "base/auto_reset.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 void Scheduler::SetNeedsForcedCommitForReadback() { 167 void Scheduler::SetNeedsForcedCommitForReadback() {
168 state_machine_.SetNeedsForcedCommitForReadback(); 168 state_machine_.SetNeedsForcedCommitForReadback();
169 ProcessScheduledActions(); 169 ProcessScheduledActions();
170 } 170 }
171 171
172 void Scheduler::SetNeedsRedraw() { 172 void Scheduler::SetNeedsRedraw() {
173 state_machine_.SetNeedsRedraw(); 173 state_machine_.SetNeedsRedraw();
174 ProcessScheduledActions(); 174 ProcessScheduledActions();
175 } 175 }
176 176
177 void Scheduler::SetNeedsAnimate() {
178 state_machine_.SetNeedsAnimate();
179 ProcessScheduledActions();
180 }
181
182 void Scheduler::SetNeedsManageTiles() { 177 void Scheduler::SetNeedsManageTiles() {
183 DCHECK(!IsInsideAction(SchedulerStateMachine::ACTION_MANAGE_TILES)); 178 DCHECK(!IsInsideAction(SchedulerStateMachine::ACTION_MANAGE_TILES));
184 state_machine_.SetNeedsManageTiles(); 179 state_machine_.SetNeedsManageTiles();
185 ProcessScheduledActions(); 180 ProcessScheduledActions();
186 } 181 }
187 182
188 void Scheduler::SetMaxSwapsPending(int max) { 183 void Scheduler::SetMaxSwapsPending(int max) {
189 state_machine_.SetMaxSwapsPending(max); 184 state_machine_.SetMaxSwapsPending(max);
190 } 185 }
191 186
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("cc.debug.scheduler"), 623 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("cc.debug.scheduler"),
629 "SchedulerStateMachine", 624 "SchedulerStateMachine",
630 "state", 625 "state",
631 TracedValue::FromValue(StateAsValue().release())); 626 TracedValue::FromValue(StateAsValue().release()));
632 state_machine_.UpdateState(action); 627 state_machine_.UpdateState(action);
633 base::AutoReset<SchedulerStateMachine::Action> 628 base::AutoReset<SchedulerStateMachine::Action>
634 mark_inside_action(&inside_action_, action); 629 mark_inside_action(&inside_action_, action);
635 switch (action) { 630 switch (action) {
636 case SchedulerStateMachine::ACTION_NONE: 631 case SchedulerStateMachine::ACTION_NONE:
637 break; 632 break;
638 case SchedulerStateMachine::ACTION_ANIMATE:
639 client_->ScheduledActionAnimate();
640 break;
641 case SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME: 633 case SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME:
642 client_->ScheduledActionSendBeginMainFrame(); 634 client_->ScheduledActionSendBeginMainFrame();
643 break; 635 break;
644 case SchedulerStateMachine::ACTION_COMMIT: 636 case SchedulerStateMachine::ACTION_COMMIT:
645 client_->ScheduledActionCommit(); 637 client_->ScheduledActionCommit();
646 break; 638 break;
647 case SchedulerStateMachine::ACTION_UPDATE_VISIBLE_TILES: 639 case SchedulerStateMachine::ACTION_UPDATE_VISIBLE_TILES:
648 client_->ScheduledActionUpdateVisibleTiles(); 640 client_->ScheduledActionUpdateVisibleTiles();
649 break; 641 break;
650 case SchedulerStateMachine::ACTION_ACTIVATE_PENDING_TREE: 642 case SchedulerStateMachine::ACTION_ACTIVATE_PENDING_TREE:
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
736 } 728 }
737 729
738 bool Scheduler::IsBeginMainFrameSentOrStarted() const { 730 bool Scheduler::IsBeginMainFrameSentOrStarted() const {
739 return (state_machine_.commit_state() == 731 return (state_machine_.commit_state() ==
740 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || 732 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT ||
741 state_machine_.commit_state() == 733 state_machine_.commit_state() ==
742 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); 734 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED);
743 } 735 }
744 736
745 } // namespace cc 737 } // namespace cc
OLDNEW
« no previous file with comments | « trunk/src/cc/scheduler/scheduler.h ('k') | trunk/src/cc/scheduler/scheduler_state_machine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698