Chromium Code Reviews| 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 23 matching lines...) Expand all Loading... | |
| 34 class SchedulerClient { | 34 class SchedulerClient { |
| 35 public: | 35 public: |
| 36 virtual void SetNeedsBeginFrameOnImplThread(bool enable) = 0; | 36 virtual void SetNeedsBeginFrameOnImplThread(bool enable) = 0; |
| 37 virtual void ScheduledActionSendBeginFrameToMainThread() = 0; | 37 virtual void ScheduledActionSendBeginFrameToMainThread() = 0; |
| 38 virtual ScheduledActionDrawAndSwapResult | 38 virtual ScheduledActionDrawAndSwapResult |
| 39 ScheduledActionDrawAndSwapIfPossible() = 0; | 39 ScheduledActionDrawAndSwapIfPossible() = 0; |
| 40 virtual ScheduledActionDrawAndSwapResult | 40 virtual ScheduledActionDrawAndSwapResult |
| 41 ScheduledActionDrawAndSwapForced() = 0; | 41 ScheduledActionDrawAndSwapForced() = 0; |
| 42 virtual void ScheduledActionCommit() = 0; | 42 virtual void ScheduledActionCommit() = 0; |
| 43 virtual void ScheduledActionUpdateVisibleTiles() = 0; | 43 virtual void ScheduledActionUpdateVisibleTiles() = 0; |
| 44 virtual void ScheduledActionActivatePendingTreeIfNeeded() = 0; | 44 virtual void ScheduledActionActivatePendingTree() = 0; |
| 45 virtual void ScheduledActionBeginOutputSurfaceCreation() = 0; | 45 virtual void ScheduledActionBeginOutputSurfaceCreation() = 0; |
| 46 virtual void ScheduledActionAcquireLayerTexturesForMainThread() = 0; | 46 virtual void ScheduledActionAcquireLayerTexturesForMainThread() = 0; |
| 47 virtual void DidAnticipatedDrawTimeChange(base::TimeTicks time) = 0; | 47 virtual void DidAnticipatedDrawTimeChange(base::TimeTicks time) = 0; |
| 48 virtual base::TimeDelta DrawDurationEstimate() = 0; | 48 virtual base::TimeDelta DrawDurationEstimate() = 0; |
| 49 virtual base::TimeDelta BeginFrameToCommitDurationEstimate() = 0; | 49 virtual base::TimeDelta BeginFrameToCommitDurationEstimate() = 0; |
| 50 virtual base::TimeDelta CommitToActivateDurationEstimate() = 0; | 50 virtual base::TimeDelta CommitToActivateDurationEstimate() = 0; |
| 51 | 51 |
| 52 protected: | 52 protected: |
| 53 virtual ~SchedulerClient() {} | 53 virtual ~SchedulerClient() {} |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 class CC_EXPORT Scheduler { | 56 class CC_EXPORT Scheduler { |
| 57 public: | 57 public: |
| 58 static scoped_ptr<Scheduler> Create( | 58 static scoped_ptr<Scheduler> Create( |
| 59 SchedulerClient* client, | 59 SchedulerClient* client, |
| 60 const SchedulerSettings& scheduler_settings) { | 60 const SchedulerSettings& scheduler_settings) { |
| 61 return make_scoped_ptr(new Scheduler(client, scheduler_settings)); | 61 return make_scoped_ptr(new Scheduler(client, scheduler_settings)); |
| 62 } | 62 } |
| 63 | 63 |
| 64 virtual ~Scheduler(); | 64 virtual ~Scheduler(); |
| 65 | 65 |
| 66 void SetCanStart(); | 66 void SetCanStart(); |
| 67 | 67 |
| 68 void SetVisible(bool visible); | 68 void SetVisible(bool visible); |
| 69 void SetCanDraw(bool can_draw); | 69 void SetCanDraw(bool can_draw); |
| 70 void SetHasPendingTree(bool has_pending_tree); | 70 void NotifyReadyToActivate(); |
| 71 void SetHasTrees(bool has_pending_tree, bool active_tree_is_null); | |
|
reveman
2013/08/23 16:16:48
has_active_tree? find it confusing that active tre
enne (OOO)
2013/08/23 17:54:09
Doesn't the scheduler already know this informatio
brianderson
2013/08/23 18:17:38
Hmm. I used active_tree_is_null because, technical
brianderson
2013/08/23 18:17:38
Is it safe to assume that the active tree's root l
enne (OOO)
2013/08/23 18:30:35
Ok, good point. I don't think we do, but I think
| |
| 71 | 72 |
| 72 void SetNeedsCommit(); | 73 void SetNeedsCommit(); |
| 73 | 74 |
| 74 // Like SetNeedsCommit(), but ensures a commit will definitely happen even if | 75 // Like SetNeedsCommit(), but ensures a commit will definitely happen even if |
| 75 // we are not visible. | 76 // we are not visible. |
| 76 void SetNeedsForcedCommit(); | 77 void SetNeedsForcedCommit(); |
| 77 | 78 |
| 78 void SetNeedsRedraw(); | 79 void SetNeedsRedraw(); |
| 79 | 80 |
| 80 void SetMainThreadNeedsLayerTextures(); | 81 void SetMainThreadNeedsLayerTextures(); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 131 | 132 |
| 132 SchedulerStateMachine state_machine_; | 133 SchedulerStateMachine state_machine_; |
| 133 bool inside_process_scheduled_actions_; | 134 bool inside_process_scheduled_actions_; |
| 134 | 135 |
| 135 DISALLOW_COPY_AND_ASSIGN(Scheduler); | 136 DISALLOW_COPY_AND_ASSIGN(Scheduler); |
| 136 }; | 137 }; |
| 137 | 138 |
| 138 } // namespace cc | 139 } // namespace cc |
| 139 | 140 |
| 140 #endif // CC_SCHEDULER_SCHEDULER_H_ | 141 #endif // CC_SCHEDULER_SCHEDULER_H_ |
| OLD | NEW |