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

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: Cleanup. 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 void Scheduler::SetNeedsForcedCommitForReadback() { 69 void Scheduler::SetNeedsForcedCommitForReadback() {
70 state_machine_.SetNeedsForcedCommitForReadback(); 70 state_machine_.SetNeedsForcedCommitForReadback();
71 ProcessScheduledActions(); 71 ProcessScheduledActions();
72 } 72 }
73 73
74 void Scheduler::SetNeedsRedraw() { 74 void Scheduler::SetNeedsRedraw() {
75 state_machine_.SetNeedsRedraw(); 75 state_machine_.SetNeedsRedraw();
76 ProcessScheduledActions(); 76 ProcessScheduledActions();
77 } 77 }
78 78
79 void Scheduler::SetNeedsAnimate() {
80 state_machine_.SetNeedsAnimate();
81 ProcessScheduledActions();
82 }
83
79 void Scheduler::SetNeedsManageTiles() { 84 void Scheduler::SetNeedsManageTiles() {
80 DCHECK(!IsInsideAction(SchedulerStateMachine::ACTION_MANAGE_TILES)); 85 DCHECK(!IsInsideAction(SchedulerStateMachine::ACTION_MANAGE_TILES));
81 state_machine_.SetNeedsManageTiles(); 86 state_machine_.SetNeedsManageTiles();
82 ProcessScheduledActions(); 87 ProcessScheduledActions();
83 } 88 }
84 89
85 void Scheduler::SetSwapUsedIncompleteTile(bool used_incomplete_tile) { 90 void Scheduler::SetSwapUsedIncompleteTile(bool used_incomplete_tile) {
86 state_machine_.SetSwapUsedIncompleteTile(used_incomplete_tile); 91 state_machine_.SetSwapUsedIncompleteTile(used_incomplete_tile);
87 ProcessScheduledActions(); 92 ProcessScheduledActions();
88 } 93 }
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("cc.debug.scheduler"), 359 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("cc.debug.scheduler"),
355 "SchedulerStateMachine", 360 "SchedulerStateMachine",
356 "state", 361 "state",
357 TracedValue::FromValue(StateAsValue().release())); 362 TracedValue::FromValue(StateAsValue().release()));
358 state_machine_.UpdateState(action); 363 state_machine_.UpdateState(action);
359 base::AutoReset<SchedulerStateMachine::Action> 364 base::AutoReset<SchedulerStateMachine::Action>
360 mark_inside_action(&inside_action_, action); 365 mark_inside_action(&inside_action_, action);
361 switch (action) { 366 switch (action) {
362 case SchedulerStateMachine::ACTION_NONE: 367 case SchedulerStateMachine::ACTION_NONE:
363 break; 368 break;
369 case SchedulerStateMachine::ACTION_ANIMATE:
370 client_->ScheduledActionAnimate();
371 break;
364 case SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME: 372 case SchedulerStateMachine::ACTION_SEND_BEGIN_MAIN_FRAME:
365 client_->ScheduledActionSendBeginMainFrame(); 373 client_->ScheduledActionSendBeginMainFrame();
366 break; 374 break;
367 case SchedulerStateMachine::ACTION_COMMIT: 375 case SchedulerStateMachine::ACTION_COMMIT:
368 client_->ScheduledActionCommit(); 376 client_->ScheduledActionCommit();
369 break; 377 break;
370 case SchedulerStateMachine::ACTION_UPDATE_VISIBLE_TILES: 378 case SchedulerStateMachine::ACTION_UPDATE_VISIBLE_TILES:
371 client_->ScheduledActionUpdateVisibleTiles(); 379 client_->ScheduledActionUpdateVisibleTiles();
372 break; 380 break;
373 case SchedulerStateMachine::ACTION_ACTIVATE_PENDING_TREE: 381 case SchedulerStateMachine::ACTION_ACTIVATE_PENDING_TREE:
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
451 } 459 }
452 460
453 bool Scheduler::IsBeginMainFrameSentOrStarted() const { 461 bool Scheduler::IsBeginMainFrameSentOrStarted() const {
454 return (state_machine_.commit_state() == 462 return (state_machine_.commit_state() ==
455 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || 463 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT ||
456 state_machine_.commit_state() == 464 state_machine_.commit_state() ==
457 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); 465 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED);
458 } 466 }
459 467
460 } // namespace cc 468 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698