| 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 bool CommitPending() const { return state_machine_.CommitPending(); } | 91 bool CommitPending() const { return state_machine_.CommitPending(); } |
| 92 bool RedrawPending() const { return state_machine_.RedrawPending(); } | 92 bool RedrawPending() const { return state_machine_.RedrawPending(); } |
| 93 | 93 |
| 94 bool WillDrawIfNeeded() const; | 94 bool WillDrawIfNeeded() const; |
| 95 | 95 |
| 96 base::TimeTicks AnticipatedDrawTime(); | 96 base::TimeTicks AnticipatedDrawTime(); |
| 97 | 97 |
| 98 base::TimeTicks LastBeginFrameOnImplThreadTime(); | 98 base::TimeTicks LastBeginFrameOnImplThreadTime(); |
| 99 | 99 |
| 100 void BeginFrame(const BeginFrameArgs& args); | 100 void BeginFrame(const BeginFrameArgs& args); |
| 101 void PollForAnticipatedDrawTriggers(); |
| 101 | 102 |
| 102 scoped_ptr<base::Value> StateAsValue() { | 103 scoped_ptr<base::Value> StateAsValue() { |
| 103 return state_machine_.AsValue().Pass(); | 104 return state_machine_.AsValue().Pass(); |
| 104 } | 105 } |
| 105 | 106 |
| 106 private: | 107 private: |
| 107 Scheduler(SchedulerClient* client, | 108 Scheduler(SchedulerClient* client, |
| 108 const SchedulerSettings& scheduler_settings); | 109 const SchedulerSettings& scheduler_settings); |
| 109 | 110 |
| 110 void SetupNextBeginFrameIfNeeded(); | 111 void SetupNextBeginFrameIfNeeded(); |
| 111 void DrawAndSwapIfPossible(); | 112 void DrawAndSwapIfPossible(); |
| 112 void DrawAndSwapForced(); | 113 void DrawAndSwapForced(); |
| 113 void DrawAndReadback(); | 114 void DrawAndReadback(); |
| 114 void ProcessScheduledActions(); | 115 void ProcessScheduledActions(); |
| 115 | 116 |
| 116 const SchedulerSettings settings_; | 117 const SchedulerSettings settings_; |
| 117 SchedulerClient* client_; | 118 SchedulerClient* client_; |
| 118 | 119 |
| 119 base::WeakPtrFactory<Scheduler> weak_factory_; | 120 base::WeakPtrFactory<Scheduler> weak_factory_; |
| 120 bool last_set_needs_begin_frame_; | 121 bool last_set_needs_begin_frame_; |
| 121 bool has_pending_begin_frame_; | 122 bool has_pending_begin_frame_; |
| 122 BeginFrameArgs last_begin_frame_args_; | 123 BeginFrameArgs last_begin_frame_args_; |
| 124 base::CancelableClosure poll_for_draw_triggers_closure_; |
| 123 | 125 |
| 124 SchedulerStateMachine state_machine_; | 126 SchedulerStateMachine state_machine_; |
| 125 bool inside_process_scheduled_actions_; | 127 bool inside_process_scheduled_actions_; |
| 126 | 128 |
| 127 DISALLOW_COPY_AND_ASSIGN(Scheduler); | 129 DISALLOW_COPY_AND_ASSIGN(Scheduler); |
| 128 }; | 130 }; |
| 129 | 131 |
| 130 } // namespace cc | 132 } // namespace cc |
| 131 | 133 |
| 132 #endif // CC_SCHEDULER_SCHEDULER_H_ | 134 #endif // CC_SCHEDULER_SCHEDULER_H_ |
| OLD | NEW |