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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 void DidCreateAndInitializeOutputSurface(); | 95 void DidCreateAndInitializeOutputSurface(); |
96 bool HasInitializedOutputSurface() const { | 96 bool HasInitializedOutputSurface() const { |
97 return state_machine_.HasInitializedOutputSurface(); | 97 return state_machine_.HasInitializedOutputSurface(); |
98 } | 98 } |
99 | 99 |
100 bool CommitPending() const { return state_machine_.CommitPending(); } | 100 bool CommitPending() const { return state_machine_.CommitPending(); } |
101 bool RedrawPending() const { return state_machine_.RedrawPending(); } | 101 bool RedrawPending() const { return state_machine_.RedrawPending(); } |
102 bool ManageTilesPending() const { | 102 bool ManageTilesPending() const { |
103 return state_machine_.ManageTilesPending(); | 103 return state_machine_.ManageTilesPending(); |
104 } | 104 } |
| 105 bool MainThreadIsInHighLatencyMode() const { |
| 106 return state_machine_.MainThreadIsInHighLatencyMode(); |
| 107 } |
105 | 108 |
106 bool WillDrawIfNeeded() const; | 109 bool WillDrawIfNeeded() const; |
107 | 110 |
108 base::TimeTicks AnticipatedDrawTime(); | 111 base::TimeTicks AnticipatedDrawTime(); |
109 | 112 |
110 base::TimeTicks LastBeginImplFrameTime(); | 113 base::TimeTicks LastBeginImplFrameTime(); |
111 | 114 |
112 void BeginImplFrame(const BeginFrameArgs& args); | 115 void BeginImplFrame(const BeginFrameArgs& args); |
113 void OnBeginImplFrameDeadline(); | 116 void OnBeginImplFrameDeadline(); |
114 void PollForAnticipatedDrawTriggers(); | 117 void PollForAnticipatedDrawTriggers(); |
(...skipping 11 matching lines...) Expand all Loading... |
126 const SchedulerSettings& scheduler_settings); | 129 const SchedulerSettings& scheduler_settings); |
127 | 130 |
128 void PostBeginImplFrameDeadline(base::TimeTicks deadline); | 131 void PostBeginImplFrameDeadline(base::TimeTicks deadline); |
129 void SetupNextBeginImplFrameIfNeeded(); | 132 void SetupNextBeginImplFrameIfNeeded(); |
130 void ActivatePendingTree(); | 133 void ActivatePendingTree(); |
131 void DrawAndSwapIfPossible(); | 134 void DrawAndSwapIfPossible(); |
132 void DrawAndSwapForced(); | 135 void DrawAndSwapForced(); |
133 void DrawAndReadback(); | 136 void DrawAndReadback(); |
134 void ProcessScheduledActions(); | 137 void ProcessScheduledActions(); |
135 | 138 |
| 139 bool CanCommitAndActivateBeforeDeadline() const; |
| 140 |
136 const SchedulerSettings settings_; | 141 const SchedulerSettings settings_; |
137 SchedulerClient* client_; | 142 SchedulerClient* client_; |
138 | 143 |
139 bool last_set_needs_begin_impl_frame_; | 144 bool last_set_needs_begin_impl_frame_; |
140 BeginFrameArgs last_begin_impl_frame_args_; | 145 BeginFrameArgs last_begin_impl_frame_args_; |
141 base::CancelableClosure begin_impl_frame_deadline_closure_; | 146 base::CancelableClosure begin_impl_frame_deadline_closure_; |
142 base::CancelableClosure poll_for_draw_triggers_closure_; | 147 base::CancelableClosure poll_for_draw_triggers_closure_; |
143 | 148 |
144 SchedulerStateMachine state_machine_; | 149 SchedulerStateMachine state_machine_; |
145 bool inside_process_scheduled_actions_; | 150 bool inside_process_scheduled_actions_; |
146 SchedulerStateMachine::Action inside_action_; | 151 SchedulerStateMachine::Action inside_action_; |
147 | 152 |
148 base::WeakPtrFactory<Scheduler> weak_factory_; | 153 base::WeakPtrFactory<Scheduler> weak_factory_; |
149 | 154 |
150 DISALLOW_COPY_AND_ASSIGN(Scheduler); | 155 DISALLOW_COPY_AND_ASSIGN(Scheduler); |
151 }; | 156 }; |
152 | 157 |
153 } // namespace cc | 158 } // namespace cc |
154 | 159 |
155 #endif // CC_SCHEDULER_SCHEDULER_H_ | 160 #endif // CC_SCHEDULER_SCHEDULER_H_ |
OLD | NEW |