| 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 #ifndef CC_SCHEDULER_SCHEDULER_H_ | 5 #ifndef CC_SCHEDULER_SCHEDULER_H_ |
| 6 #define CC_SCHEDULER_SCHEDULER_H_ | 6 #define CC_SCHEDULER_SCHEDULER_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 return !begin_impl_frame_deadline_task_.IsCancelled(); | 117 return !begin_impl_frame_deadline_task_.IsCancelled(); |
| 118 } | 118 } |
| 119 | 119 |
| 120 bool WillDrawIfNeeded() const; | 120 bool WillDrawIfNeeded() const; |
| 121 | 121 |
| 122 base::TimeTicks AnticipatedDrawTime() const; | 122 base::TimeTicks AnticipatedDrawTime() const; |
| 123 | 123 |
| 124 void NotifyBeginMainFrameStarted(); | 124 void NotifyBeginMainFrameStarted(); |
| 125 | 125 |
| 126 base::TimeTicks LastBeginImplFrameTime(); | 126 base::TimeTicks LastBeginImplFrameTime(); |
| 127 base::TimeDelta VSyncInterval() { return vsync_interval_; } | |
| 128 base::TimeDelta EstimatedParentDrawTime() { | |
| 129 return estimated_parent_draw_time_; | |
| 130 } | |
| 131 | 127 |
| 132 void BeginFrame(const BeginFrameArgs& args); | 128 void BeginFrame(const BeginFrameArgs& args); |
| 133 void PostBeginRetroFrame(); | |
| 134 void BeginRetroFrame(); | |
| 135 void BeginUnthrottledFrame(); | |
| 136 | |
| 137 void BeginImplFrame(const BeginFrameArgs& args); | |
| 138 void OnBeginImplFrameDeadline(); | |
| 139 void PollForAnticipatedDrawTriggers(); | |
| 140 void PollToAdvanceCommitState(); | |
| 141 | 129 |
| 142 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const; | 130 scoped_refptr<base::debug::ConvertableToTraceFormat> AsValue() const; |
| 143 | 131 |
| 144 bool IsInsideAction(SchedulerStateMachine::Action action) { | |
| 145 return inside_action_ == action; | |
| 146 } | |
| 147 | |
| 148 bool IsBeginMainFrameSent() const; | |
| 149 void SetContinuousPainting(bool continuous_painting) { | 132 void SetContinuousPainting(bool continuous_painting) { |
| 150 state_machine_.SetContinuousPainting(continuous_painting); | 133 state_machine_.SetContinuousPainting(continuous_painting); |
| 151 } | 134 } |
| 152 | 135 |
| 153 protected: | 136 protected: |
| 154 class CC_EXPORT SyntheticBeginFrameSource : public TimeSourceClient { | 137 class CC_EXPORT SyntheticBeginFrameSource : public TimeSourceClient { |
| 155 public: | 138 public: |
| 156 SyntheticBeginFrameSource(Scheduler* scheduler, | 139 SyntheticBeginFrameSource(Scheduler* scheduler, |
| 157 base::SingleThreadTaskRunner* task_runner); | 140 base::SingleThreadTaskRunner* task_runner); |
| 158 virtual ~SyntheticBeginFrameSource(); | 141 virtual ~SyntheticBeginFrameSource(); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 void PostBeginRetroFrameIfNeeded(); | 207 void PostBeginRetroFrameIfNeeded(); |
| 225 void SetupNextBeginFrameWhenVSyncThrottlingEnabled(bool needs_begin_frame); | 208 void SetupNextBeginFrameWhenVSyncThrottlingEnabled(bool needs_begin_frame); |
| 226 void SetupNextBeginFrameWhenVSyncThrottlingDisabled(bool needs_begin_frame); | 209 void SetupNextBeginFrameWhenVSyncThrottlingDisabled(bool needs_begin_frame); |
| 227 void SetupPollingMechanisms(bool needs_begin_frame); | 210 void SetupPollingMechanisms(bool needs_begin_frame); |
| 228 void DrawAndSwapIfPossible(); | 211 void DrawAndSwapIfPossible(); |
| 229 void ProcessScheduledActions(); | 212 void ProcessScheduledActions(); |
| 230 bool CanCommitAndActivateBeforeDeadline() const; | 213 bool CanCommitAndActivateBeforeDeadline() const; |
| 231 void AdvanceCommitStateIfPossible(); | 214 void AdvanceCommitStateIfPossible(); |
| 232 bool IsBeginMainFrameSentOrStarted() const; | 215 bool IsBeginMainFrameSentOrStarted() const; |
| 233 void SetupSyntheticBeginFrames(); | 216 void SetupSyntheticBeginFrames(); |
| 217 void BeginRetroFrame(); |
| 218 void BeginUnthrottledFrame(); |
| 219 void BeginImplFrame(const BeginFrameArgs& args); |
| 220 void OnBeginImplFrameDeadline(); |
| 221 void PollForAnticipatedDrawTriggers(); |
| 222 void PollToAdvanceCommitState(); |
| 223 |
| 224 base::TimeDelta VSyncInterval() { return vsync_interval_; } |
| 225 |
| 226 base::TimeDelta EstimatedParentDrawTime() { |
| 227 return estimated_parent_draw_time_; |
| 228 } |
| 229 |
| 230 bool IsInsideAction(SchedulerStateMachine::Action action) { |
| 231 return inside_action_ == action; |
| 232 } |
| 234 | 233 |
| 235 base::WeakPtrFactory<Scheduler> weak_factory_; | 234 base::WeakPtrFactory<Scheduler> weak_factory_; |
| 236 | 235 |
| 237 DISALLOW_COPY_AND_ASSIGN(Scheduler); | 236 DISALLOW_COPY_AND_ASSIGN(Scheduler); |
| 238 }; | 237 }; |
| 239 | 238 |
| 240 } // namespace cc | 239 } // namespace cc |
| 241 | 240 |
| 242 #endif // CC_SCHEDULER_SCHEDULER_H_ | 241 #endif // CC_SCHEDULER_SCHEDULER_H_ |
| OLD | NEW |