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

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

Issue 311263016: cc: Fix negative EstimatedParentDrawTimes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix flaky LayerTreeHostAnimationTestAddAnimationAfterAnimating Created 6 years, 6 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/output/begin_frame_args.cc ('k') | cc/trees/layer_tree_host_impl.cc » ('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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 base::TimeDelta interval) { 130 base::TimeDelta interval) {
131 // TODO(brianderson): We should not be receiving 0 intervals. 131 // TODO(brianderson): We should not be receiving 0 intervals.
132 if (interval == base::TimeDelta()) 132 if (interval == base::TimeDelta())
133 interval = BeginFrameArgs::DefaultInterval(); 133 interval = BeginFrameArgs::DefaultInterval();
134 vsync_interval_ = interval; 134 vsync_interval_ = interval;
135 if (!settings_.begin_frame_scheduling_enabled) 135 if (!settings_.begin_frame_scheduling_enabled)
136 synthetic_begin_frame_source_->CommitVSyncParameters(timebase, interval); 136 synthetic_begin_frame_source_->CommitVSyncParameters(timebase, interval);
137 } 137 }
138 138
139 void Scheduler::SetEstimatedParentDrawTime(base::TimeDelta draw_time) { 139 void Scheduler::SetEstimatedParentDrawTime(base::TimeDelta draw_time) {
140 DCHECK_GE(draw_time.ToInternalValue(), 0);
140 estimated_parent_draw_time_ = draw_time; 141 estimated_parent_draw_time_ = draw_time;
141 } 142 }
142 143
143 void Scheduler::SetCanStart() { 144 void Scheduler::SetCanStart() {
144 state_machine_.SetCanStart(); 145 state_machine_.SetCanStart();
145 ProcessScheduledActions(); 146 ProcessScheduledActions();
146 } 147 }
147 148
148 void Scheduler::SetVisible(bool visible) { 149 void Scheduler::SetVisible(bool visible) {
149 state_machine_.SetVisible(visible); 150 state_machine_.SetVisible(visible);
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 } 738 }
738 739
739 bool Scheduler::IsBeginMainFrameSentOrStarted() const { 740 bool Scheduler::IsBeginMainFrameSentOrStarted() const {
740 return (state_machine_.commit_state() == 741 return (state_machine_.commit_state() ==
741 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT || 742 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_SENT ||
742 state_machine_.commit_state() == 743 state_machine_.commit_state() ==
743 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED); 744 SchedulerStateMachine::COMMIT_STATE_BEGIN_MAIN_FRAME_STARTED);
744 } 745 }
745 746
746 } // namespace cc 747 } // namespace cc
OLDNEW
« no previous file with comments | « cc/output/begin_frame_args.cc ('k') | cc/trees/layer_tree_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698