| 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 24 matching lines...) Expand all Loading... |
| 35 class SchedulerClient { | 35 class SchedulerClient { |
| 36 public: | 36 public: |
| 37 virtual void WillBeginImplFrame(const BeginFrameArgs& args) = 0; | 37 virtual void WillBeginImplFrame(const BeginFrameArgs& args) = 0; |
| 38 virtual void ScheduledActionSendBeginMainFrame() = 0; | 38 virtual void ScheduledActionSendBeginMainFrame() = 0; |
| 39 virtual DrawResult ScheduledActionDrawAndSwapIfPossible() = 0; | 39 virtual DrawResult ScheduledActionDrawAndSwapIfPossible() = 0; |
| 40 virtual DrawResult ScheduledActionDrawAndSwapForced() = 0; | 40 virtual DrawResult ScheduledActionDrawAndSwapForced() = 0; |
| 41 virtual void ScheduledActionAnimate() = 0; | 41 virtual void ScheduledActionAnimate() = 0; |
| 42 virtual void ScheduledActionCommit() = 0; | 42 virtual void ScheduledActionCommit() = 0; |
| 43 virtual void ScheduledActionActivateSyncTree() = 0; | 43 virtual void ScheduledActionActivateSyncTree() = 0; |
| 44 virtual void ScheduledActionBeginOutputSurfaceCreation() = 0; | 44 virtual void ScheduledActionBeginOutputSurfaceCreation() = 0; |
| 45 virtual void ScheduledActionManageTiles() = 0; | 45 virtual void ScheduledActionPrepareTiles() = 0; |
| 46 virtual void DidAnticipatedDrawTimeChange(base::TimeTicks time) = 0; | 46 virtual void DidAnticipatedDrawTimeChange(base::TimeTicks time) = 0; |
| 47 virtual base::TimeDelta DrawDurationEstimate() = 0; | 47 virtual base::TimeDelta DrawDurationEstimate() = 0; |
| 48 virtual base::TimeDelta BeginMainFrameToCommitDurationEstimate() = 0; | 48 virtual base::TimeDelta BeginMainFrameToCommitDurationEstimate() = 0; |
| 49 virtual base::TimeDelta CommitToActivateDurationEstimate() = 0; | 49 virtual base::TimeDelta CommitToActivateDurationEstimate() = 0; |
| 50 virtual void DidBeginImplFrameDeadline() = 0; | 50 virtual void DidBeginImplFrameDeadline() = 0; |
| 51 virtual void SendBeginFramesToChildren(const BeginFrameArgs& args) = 0; | 51 virtual void SendBeginFramesToChildren(const BeginFrameArgs& args) = 0; |
| 52 | 52 |
| 53 protected: | 53 protected: |
| 54 virtual ~SchedulerClient() {} | 54 virtual ~SchedulerClient() {} |
| 55 }; | 55 }; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 void SetCanDraw(bool can_draw); | 112 void SetCanDraw(bool can_draw); |
| 113 void NotifyReadyToActivate(); | 113 void NotifyReadyToActivate(); |
| 114 void NotifyReadyToDraw(); | 114 void NotifyReadyToDraw(); |
| 115 | 115 |
| 116 void SetNeedsCommit(); | 116 void SetNeedsCommit(); |
| 117 | 117 |
| 118 void SetNeedsRedraw(); | 118 void SetNeedsRedraw(); |
| 119 | 119 |
| 120 void SetNeedsAnimate(); | 120 void SetNeedsAnimate(); |
| 121 | 121 |
| 122 void SetNeedsManageTiles(); | 122 void SetNeedsPrepareTiles(); |
| 123 | 123 |
| 124 void SetMaxSwapsPending(int max); | 124 void SetMaxSwapsPending(int max); |
| 125 void DidSwapBuffers(); | 125 void DidSwapBuffers(); |
| 126 void DidSwapBuffersComplete(); | 126 void DidSwapBuffersComplete(); |
| 127 | 127 |
| 128 void SetImplLatencyTakesPriority(bool impl_latency_takes_priority); | 128 void SetImplLatencyTakesPriority(bool impl_latency_takes_priority); |
| 129 | 129 |
| 130 void NotifyReadyToCommit(); | 130 void NotifyReadyToCommit(); |
| 131 void BeginMainFrameAborted(bool did_handle); | 131 void BeginMainFrameAborted(bool did_handle); |
| 132 | 132 |
| 133 void DidManageTiles(); | 133 void DidPrepareTiles(); |
| 134 void DidLoseOutputSurface(); | 134 void DidLoseOutputSurface(); |
| 135 void DidCreateAndInitializeOutputSurface(); | 135 void DidCreateAndInitializeOutputSurface(); |
| 136 | 136 |
| 137 // Tests do not want to shut down until all possible BeginMainFrames have | 137 // Tests do not want to shut down until all possible BeginMainFrames have |
| 138 // occured to prevent flakiness. | 138 // occured to prevent flakiness. |
| 139 bool MainFrameForTestingWillHappen() const { | 139 bool MainFrameForTestingWillHappen() const { |
| 140 return state_machine_.CommitPending() || | 140 return state_machine_.CommitPending() || |
| 141 state_machine_.CouldSendBeginMainFrame(); | 141 state_machine_.CouldSendBeginMainFrame(); |
| 142 } | 142 } |
| 143 | 143 |
| 144 bool CommitPending() const { return state_machine_.CommitPending(); } | 144 bool CommitPending() const { return state_machine_.CommitPending(); } |
| 145 bool RedrawPending() const { return state_machine_.RedrawPending(); } | 145 bool RedrawPending() const { return state_machine_.RedrawPending(); } |
| 146 bool ManageTilesPending() const { | 146 bool PrepareTilesPending() const { |
| 147 return state_machine_.ManageTilesPending(); | 147 return state_machine_.PrepareTilesPending(); |
| 148 } | 148 } |
| 149 bool MainThreadIsInHighLatencyMode() const { | 149 bool MainThreadIsInHighLatencyMode() const { |
| 150 return state_machine_.MainThreadIsInHighLatencyMode(); | 150 return state_machine_.MainThreadIsInHighLatencyMode(); |
| 151 } | 151 } |
| 152 bool BeginImplFrameDeadlinePending() const { | 152 bool BeginImplFrameDeadlinePending() const { |
| 153 return !begin_impl_frame_deadline_task_.IsCancelled(); | 153 return !begin_impl_frame_deadline_task_.IsCancelled(); |
| 154 } | 154 } |
| 155 | 155 |
| 156 bool WillDrawIfNeeded() const; | 156 bool WillDrawIfNeeded() const; |
| 157 | 157 |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 | 253 |
| 254 friend class SchedulerFrameSourcesConstructor; | 254 friend class SchedulerFrameSourcesConstructor; |
| 255 friend class TestSchedulerFrameSourcesConstructor; | 255 friend class TestSchedulerFrameSourcesConstructor; |
| 256 | 256 |
| 257 DISALLOW_COPY_AND_ASSIGN(Scheduler); | 257 DISALLOW_COPY_AND_ASSIGN(Scheduler); |
| 258 }; | 258 }; |
| 259 | 259 |
| 260 } // namespace cc | 260 } // namespace cc |
| 261 | 261 |
| 262 #endif // CC_SCHEDULER_SCHEDULER_H_ | 262 #endif // CC_SCHEDULER_SCHEDULER_H_ |
| OLD | NEW |