| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |