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 "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 | 89 |
90 void SetSwapBuffersCompleteSupported(bool supported); | 90 void SetSwapBuffersCompleteSupported(bool supported); |
91 void DidSwapBuffersComplete(); | 91 void DidSwapBuffersComplete(); |
92 | 92 |
93 void DidLoseOutputSurface(); | 93 void DidLoseOutputSurface(); |
94 void DidRecreateOutputSurface(); | 94 void DidRecreateOutputSurface(); |
95 | 95 |
96 bool CommitPending() const { return state_machine_.CommitPending(); } | 96 bool CommitPending() const { return state_machine_.CommitPending(); } |
97 bool RedrawPending() const { return state_machine_.RedrawPending(); } | 97 bool RedrawPending() const { return state_machine_.RedrawPending(); } |
98 | 98 |
| 99 bool WillDrawIfNeeded() const; |
| 100 |
99 void SetTimebaseAndInterval(base::TimeTicks timebase, | 101 void SetTimebaseAndInterval(base::TimeTicks timebase, |
100 base::TimeDelta interval); | 102 base::TimeDelta interval); |
101 | 103 |
102 base::TimeTicks AnticipatedDrawTime(); | 104 base::TimeTicks AnticipatedDrawTime(); |
103 | 105 |
104 base::TimeTicks LastVSyncTime(); | 106 base::TimeTicks LastVSyncTime(); |
105 | 107 |
106 // FrameRateControllerClient implementation | 108 // FrameRateControllerClient implementation |
107 virtual void VSyncTick(bool throttled) OVERRIDE; | 109 virtual void VSyncTick(bool throttled) OVERRIDE; |
108 | 110 |
109 private: | 111 private: |
110 Scheduler(SchedulerClient* client, | 112 Scheduler(SchedulerClient* client, |
111 scoped_ptr<FrameRateController> frame_rate_controller, | 113 scoped_ptr<FrameRateController> frame_rate_controller, |
112 const SchedulerSettings& scheduler_settings); | 114 const SchedulerSettings& scheduler_settings); |
113 | 115 |
114 void ProcessScheduledActions(); | 116 void ProcessScheduledActions(); |
115 | 117 |
116 const SchedulerSettings settings_; | 118 const SchedulerSettings settings_; |
117 SchedulerClient* client_; | 119 SchedulerClient* client_; |
118 scoped_ptr<FrameRateController> frame_rate_controller_; | 120 scoped_ptr<FrameRateController> frame_rate_controller_; |
119 SchedulerStateMachine state_machine_; | 121 SchedulerStateMachine state_machine_; |
120 bool inside_process_scheduled_actions_; | 122 bool inside_process_scheduled_actions_; |
121 | 123 |
122 DISALLOW_COPY_AND_ASSIGN(Scheduler); | 124 DISALLOW_COPY_AND_ASSIGN(Scheduler); |
123 }; | 125 }; |
124 | 126 |
125 } // namespace cc | 127 } // namespace cc |
126 | 128 |
127 #endif // CC_SCHEDULER_SCHEDULER_H_ | 129 #endif // CC_SCHEDULER_SCHEDULER_H_ |
OLD | NEW |