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

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

Issue 2659123004: cc: Add scheduler support for invalidating content on impl thread. (Closed)
Patch Set: moar tests Created 3 years, 10 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
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 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 } 59 }
60 60
61 Scheduler::~Scheduler() { 61 Scheduler::~Scheduler() {
62 SetBeginFrameSource(nullptr); 62 SetBeginFrameSource(nullptr);
63 } 63 }
64 64
65 void Scheduler::Stop() { 65 void Scheduler::Stop() {
66 stopped_ = true; 66 stopped_ = true;
67 } 67 }
68 68
69 void Scheduler::SetNeedsImplSideInvalidation() {
70 state_machine_.SetNeedsImplSideInvalidation();
71 ProcessScheduledActions();
72 }
73
69 base::TimeTicks Scheduler::Now() const { 74 base::TimeTicks Scheduler::Now() const {
70 base::TimeTicks now = base::TimeTicks::Now(); 75 base::TimeTicks now = base::TimeTicks::Now();
71 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("cc.debug.scheduler.now"), 76 TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("cc.debug.scheduler.now"),
72 "Scheduler::Now", "now", now); 77 "Scheduler::Now", "now", now);
73 return now; 78 return now;
74 } 79 }
75 80
76 void Scheduler::SetVisible(bool visible) { 81 void Scheduler::SetVisible(bool visible) {
77 state_machine_.SetVisible(visible); 82 state_machine_.SetVisible(visible);
78 UpdateCompositorTimingHistoryRecordingEnabled(); 83 UpdateCompositorTimingHistoryRecordingEnabled();
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 state_machine_.WillCommit(commit_has_no_updates); 618 state_machine_.WillCommit(commit_has_no_updates);
614 client_->ScheduledActionCommit(); 619 client_->ScheduledActionCommit();
615 break; 620 break;
616 } 621 }
617 case SchedulerStateMachine::ACTION_ACTIVATE_SYNC_TREE: 622 case SchedulerStateMachine::ACTION_ACTIVATE_SYNC_TREE:
618 compositor_timing_history_->WillActivate(); 623 compositor_timing_history_->WillActivate();
619 state_machine_.WillActivate(); 624 state_machine_.WillActivate();
620 client_->ScheduledActionActivateSyncTree(); 625 client_->ScheduledActionActivateSyncTree();
621 compositor_timing_history_->DidActivate(); 626 compositor_timing_history_->DidActivate();
622 break; 627 break;
628 case SchedulerStateMachine::ACTION_PERFORM_IMPL_SIDE_INVALIDATION:
629 state_machine_.WillPerformImplSideInvalidation();
630 client_->ScheduledActionPerformImplSideInvalidation();
631 break;
623 case SchedulerStateMachine::ACTION_DRAW_IF_POSSIBLE: 632 case SchedulerStateMachine::ACTION_DRAW_IF_POSSIBLE:
624 DrawIfPossible(); 633 DrawIfPossible();
625 break; 634 break;
626 case SchedulerStateMachine::ACTION_DRAW_FORCED: 635 case SchedulerStateMachine::ACTION_DRAW_FORCED:
627 DrawForced(); 636 DrawForced();
628 break; 637 break;
629 case SchedulerStateMachine::ACTION_DRAW_ABORT: { 638 case SchedulerStateMachine::ACTION_DRAW_ABORT: {
630 // No action is actually performed, but this allows the state machine to 639 // No action is actually performed, but this allows the state machine to
631 // drain the pipeline without actually drawing. 640 // drain the pipeline without actually drawing.
632 state_machine_.AbortDraw(); 641 state_machine_.AbortDraw();
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 } 776 }
768 777
769 bool Scheduler::IsBeginMainFrameSentOrStarted() const { 778 bool Scheduler::IsBeginMainFrameSentOrStarted() const {
770 return (state_machine_.begin_main_frame_state() == 779 return (state_machine_.begin_main_frame_state() ==
771 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_SENT || 780 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_SENT ||
772 state_machine_.begin_main_frame_state() == 781 state_machine_.begin_main_frame_state() ==
773 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_STARTED); 782 SchedulerStateMachine::BEGIN_MAIN_FRAME_STATE_STARTED);
774 } 783 }
775 784
776 } // namespace cc 785 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698