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

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: Addressed comments and rebased. Created 6 years, 8 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
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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 void Scheduler::SetNeedsForcedCommitForReadback() { 79 void Scheduler::SetNeedsForcedCommitForReadback() {
80 state_machine_.SetNeedsForcedCommitForReadback(); 80 state_machine_.SetNeedsForcedCommitForReadback();
81 ProcessScheduledActions(); 81 ProcessScheduledActions();
82 } 82 }
83 83
84 void Scheduler::SetNeedsRedraw() { 84 void Scheduler::SetNeedsRedraw() {
85 state_machine_.SetNeedsRedraw(); 85 state_machine_.SetNeedsRedraw();
86 ProcessScheduledActions(); 86 ProcessScheduledActions();
87 } 87 }
88 88
89 void Scheduler::SetNeedsAnimate() {
90 state_machine_.SetNeedsAnimate();
91 ProcessScheduledActions();
92 }
93
89 void Scheduler::SetNeedsManageTiles() { 94 void Scheduler::SetNeedsManageTiles() {
90 DCHECK(!IsInsideAction(SchedulerStateMachine::ACTION_MANAGE_TILES)); 95 DCHECK(!IsInsideAction(SchedulerStateMachine::ACTION_MANAGE_TILES));
91 state_machine_.SetNeedsManageTiles(); 96 state_machine_.SetNeedsManageTiles();
92 ProcessScheduledActions(); 97 ProcessScheduledActions();
93 } 98 }
94 99
95 void Scheduler::SetSwapUsedIncompleteTile(bool used_incomplete_tile) { 100 void Scheduler::SetSwapUsedIncompleteTile(bool used_incomplete_tile) {
96 state_machine_.SetSwapUsedIncompleteTile(used_incomplete_tile); 101 state_machine_.SetSwapUsedIncompleteTile(used_incomplete_tile);
97 ProcessScheduledActions(); 102 ProcessScheduledActions();
98 } 103 }
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("cc.debug.scheduler"), 456 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("cc.debug.scheduler"),
452 "SchedulerStateMachine", 457 "SchedulerStateMachine",
453 "state", 458 "state",
454 TracedValue::FromValue(StateAsValue().release())); 459 TracedValue::FromValue(StateAsValue().release()));
455 state_machine_.UpdateState(action); 460 state_machine_.UpdateState(action);
456 base::AutoReset<SchedulerStateMachine::Action> 461 base::AutoReset<SchedulerStateMachine::Action>
457 mark_inside_action(&inside_action_, action); 462 mark_inside_action(&inside_action_, action);
458 switch (action) { 463 switch (action) {
459 case SchedulerStateMachine::ACTION_NONE: 464 case SchedulerStateMachine::ACTION_NONE:
460 break; 465 break;
466 case SchedulerStateMachine::ACTION_ANIMATE:
467 client_->ScheduledActionAnimate();
468 break;
461 case SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME: 469 case SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME:
462 client_->ScheduledActionSendBeginMainFrame(); 470 client_->ScheduledActionSendBeginMainFrame();
463 break; 471 break;
464 case SchedulerStateMachine::ACTION_COMMIT: 472 case SchedulerStateMachine::ACTION_COMMIT:
465 client_->ScheduledActionCommit(); 473 client_->ScheduledActionCommit();
466 break; 474 break;
467 case SchedulerStateMachine::ACTION_UPDATE_VISIBLE_TILES: 475 case SchedulerStateMachine::ACTION_UPDATE_VISIBLE_TILES:
468 client_->ScheduledActionUpdateVisibleTiles(); 476 client_->ScheduledActionUpdateVisibleTiles();
469 break; 477 break;
470 case SchedulerStateMachine::ACTION_ACTIVATE_PENDING_TREE: 478 case SchedulerStateMachine::ACTION_ACTIVATE_PENDING_TREE:
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 } 564 }
557 565
558 bool Scheduler::IsBeginMainFrameSentOrStarted() const { 566 bool Scheduler::IsBeginMainFrameSentOrStarted() const {
559 return (state_machine_.commit_state() == 567 return (state_machine_.commit_state() ==
560 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || 568 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT ||
561 state_machine_.commit_state() == 569 state_machine_.commit_state() ==
562 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); 570 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED);
563 } 571 }
564 572
565 } // namespace cc 573 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698