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

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

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

Powered by Google App Engine
This is Rietveld 408576698