| 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 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/cancelable_callback.h" | 12 #include "base/cancelable_callback.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 15 #include "cc/base/cc_export.h" | 15 #include "cc/base/cc_export.h" |
| 16 #include "cc/output/begin_frame_args.h" | 16 #include "cc/output/begin_frame_args.h" |
| 17 #include "cc/scheduler/draw_swap_readback_result.h" | 17 #include "cc/scheduler/draw_result.h" |
| 18 #include "cc/scheduler/scheduler_settings.h" | 18 #include "cc/scheduler/scheduler_settings.h" |
| 19 #include "cc/scheduler/scheduler_state_machine.h" | 19 #include "cc/scheduler/scheduler_state_machine.h" |
| 20 #include "cc/scheduler/time_source.h" | 20 #include "cc/scheduler/time_source.h" |
| 21 #include "cc/trees/layer_tree_host.h" | 21 #include "cc/trees/layer_tree_host.h" |
| 22 | 22 |
| 23 namespace cc { | 23 namespace cc { |
| 24 | 24 |
| 25 class Thread; | 25 class Thread; |
| 26 class SyntheticBeginFrameSource; | 26 class SyntheticBeginFrameSource; |
| 27 | 27 |
| 28 class SchedulerClient { | 28 class SchedulerClient { |
| 29 public: | 29 public: |
| 30 virtual void SetNeedsBeginFrame(bool enable) = 0; | 30 virtual void SetNeedsBeginFrame(bool enable) = 0; |
| 31 virtual void WillBeginImplFrame(const BeginFrameArgs& args) = 0; | 31 virtual void WillBeginImplFrame(const BeginFrameArgs& args) = 0; |
| 32 virtual void ScheduledActionSendBeginMainFrame() = 0; | 32 virtual void ScheduledActionSendBeginMainFrame() = 0; |
| 33 virtual DrawSwapReadbackResult ScheduledActionDrawAndSwapIfPossible() = 0; | 33 virtual DrawResult ScheduledActionDrawAndSwapIfPossible() = 0; |
| 34 virtual DrawSwapReadbackResult ScheduledActionDrawAndSwapForced() = 0; | 34 virtual DrawResult ScheduledActionDrawAndSwapForced() = 0; |
| 35 virtual DrawSwapReadbackResult ScheduledActionDrawAndReadback() = 0; | 35 virtual DrawResult ScheduledActionDrawAndReadback() = 0; |
| 36 virtual void ScheduledActionAnimate() = 0; | 36 virtual void ScheduledActionAnimate() = 0; |
| 37 virtual void ScheduledActionCommit() = 0; | 37 virtual void ScheduledActionCommit() = 0; |
| 38 virtual void ScheduledActionUpdateVisibleTiles() = 0; | 38 virtual void ScheduledActionUpdateVisibleTiles() = 0; |
| 39 virtual void ScheduledActionActivatePendingTree() = 0; | 39 virtual void ScheduledActionActivatePendingTree() = 0; |
| 40 virtual void ScheduledActionBeginOutputSurfaceCreation() = 0; | 40 virtual void ScheduledActionBeginOutputSurfaceCreation() = 0; |
| 41 virtual void ScheduledActionManageTiles() = 0; | 41 virtual void ScheduledActionManageTiles() = 0; |
| 42 virtual void DidAnticipatedDrawTimeChange(base::TimeTicks time) = 0; | 42 virtual void DidAnticipatedDrawTimeChange(base::TimeTicks time) = 0; |
| 43 virtual base::TimeDelta DrawDurationEstimate() = 0; | 43 virtual base::TimeDelta DrawDurationEstimate() = 0; |
| 44 virtual base::TimeDelta BeginMainFrameToCommitDurationEstimate() = 0; | 44 virtual base::TimeDelta BeginMainFrameToCommitDurationEstimate() = 0; |
| 45 virtual base::TimeDelta CommitToActivateDurationEstimate() = 0; | 45 virtual base::TimeDelta CommitToActivateDurationEstimate() = 0; |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 const BeginFrameArgs& args, | 159 const BeginFrameArgs& args, |
| 160 base::TimeDelta draw_duration_estimate) const; | 160 base::TimeDelta draw_duration_estimate) const; |
| 161 void ScheduleBeginImplFrameDeadline(base::TimeTicks deadline); | 161 void ScheduleBeginImplFrameDeadline(base::TimeTicks deadline); |
| 162 void SetupNextBeginFrameIfNeeded(); | 162 void SetupNextBeginFrameIfNeeded(); |
| 163 void PostBeginRetroFrameIfNeeded(); | 163 void PostBeginRetroFrameIfNeeded(); |
| 164 void SetupNextBeginFrameWhenVSyncThrottlingEnabled(bool needs_begin_frame); | 164 void SetupNextBeginFrameWhenVSyncThrottlingEnabled(bool needs_begin_frame); |
| 165 void SetupNextBeginFrameWhenVSyncThrottlingDisabled(bool needs_begin_frame); | 165 void SetupNextBeginFrameWhenVSyncThrottlingDisabled(bool needs_begin_frame); |
| 166 void SetupPollingMechanisms(bool needs_begin_frame); | 166 void SetupPollingMechanisms(bool needs_begin_frame); |
| 167 void ActivatePendingTree(); | 167 void ActivatePendingTree(); |
| 168 void DrawAndSwapIfPossible(); | 168 void DrawAndSwapIfPossible(); |
| 169 void DrawAndSwapForced(); | |
| 170 void DrawAndReadback(); | |
| 171 void ProcessScheduledActions(); | 169 void ProcessScheduledActions(); |
| 172 | 170 |
| 173 bool CanCommitAndActivateBeforeDeadline() const; | 171 bool CanCommitAndActivateBeforeDeadline() const; |
| 174 void AdvanceCommitStateIfPossible(); | 172 void AdvanceCommitStateIfPossible(); |
| 175 | 173 |
| 176 bool IsBeginMainFrameSentOrStarted() const; | 174 bool IsBeginMainFrameSentOrStarted() const; |
| 177 | 175 |
| 178 const SchedulerSettings settings_; | 176 const SchedulerSettings settings_; |
| 179 SchedulerClient* client_; | 177 SchedulerClient* client_; |
| 180 int layer_tree_host_id_; | 178 int layer_tree_host_id_; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 207 SchedulerStateMachine::Action inside_action_; | 205 SchedulerStateMachine::Action inside_action_; |
| 208 | 206 |
| 209 base::WeakPtrFactory<Scheduler> weak_factory_; | 207 base::WeakPtrFactory<Scheduler> weak_factory_; |
| 210 | 208 |
| 211 DISALLOW_COPY_AND_ASSIGN(Scheduler); | 209 DISALLOW_COPY_AND_ASSIGN(Scheduler); |
| 212 }; | 210 }; |
| 213 | 211 |
| 214 } // namespace cc | 212 } // namespace cc |
| 215 | 213 |
| 216 #endif // CC_SCHEDULER_SCHEDULER_H_ | 214 #endif // CC_SCHEDULER_SCHEDULER_H_ |
| OLD | NEW |