| 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_H_ | 5 #ifndef CC_SCHEDULER_H_ |
| 6 #define CC_SCHEDULER_H_ | 6 #define CC_SCHEDULER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 bool didDraw; | 40 bool didDraw; |
| 41 bool didSwap; | 41 bool didSwap; |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 class SchedulerClient { | 44 class SchedulerClient { |
| 45 public: | 45 public: |
| 46 virtual void scheduledActionBeginFrame() = 0; | 46 virtual void scheduledActionBeginFrame() = 0; |
| 47 virtual ScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapIfPossibl
e() = 0; | 47 virtual ScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapIfPossibl
e() = 0; |
| 48 virtual ScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapForced()
= 0; | 48 virtual ScheduledActionDrawAndSwapResult scheduledActionDrawAndSwapForced()
= 0; |
| 49 virtual void scheduledActionCommit() = 0; | 49 virtual void scheduledActionCommit() = 0; |
| 50 virtual void scheduledActionCheckForNewTextures() = 0; |
| 50 virtual void scheduledActionActivatePendingTreeIfNeeded() = 0; | 51 virtual void scheduledActionActivatePendingTreeIfNeeded() = 0; |
| 51 virtual void scheduledActionBeginContextRecreation() = 0; | 52 virtual void scheduledActionBeginContextRecreation() = 0; |
| 52 virtual void scheduledActionAcquireLayerTexturesForMainThread() = 0; | 53 virtual void scheduledActionAcquireLayerTexturesForMainThread() = 0; |
| 53 virtual void didAnticipatedDrawTimeChange(base::TimeTicks) = 0; | 54 virtual void didAnticipatedDrawTimeChange(base::TimeTicks) = 0; |
| 54 | 55 |
| 55 protected: | 56 protected: |
| 56 virtual ~SchedulerClient() { } | 57 virtual ~SchedulerClient() { } |
| 57 }; | 58 }; |
| 58 | 59 |
| 59 class CC_EXPORT Scheduler : FrameRateControllerClient { | 60 class CC_EXPORT Scheduler : FrameRateControllerClient { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 72 void setVisible(bool); | 73 void setVisible(bool); |
| 73 void setCanDraw(bool); | 74 void setCanDraw(bool); |
| 74 void setHasPendingTree(bool); | 75 void setHasPendingTree(bool); |
| 75 | 76 |
| 76 void setNeedsCommit(); | 77 void setNeedsCommit(); |
| 77 | 78 |
| 78 // Like setNeedsCommit(), but ensures a commit will definitely happen even i
f we are not visible. | 79 // Like setNeedsCommit(), but ensures a commit will definitely happen even i
f we are not visible. |
| 79 void setNeedsForcedCommit(); | 80 void setNeedsForcedCommit(); |
| 80 | 81 |
| 81 void setNeedsRedraw(); | 82 void setNeedsRedraw(); |
| 83 void setNeedsRedrawOnVisibleTextureUpload(); |
| 82 | 84 |
| 83 void setMainThreadNeedsLayerTextures(); | 85 void setMainThreadNeedsLayerTextures(); |
| 84 | 86 |
| 85 // Like setNeedsRedraw(), but ensures the draw will definitely happen even i
f we are not visible. | 87 // Like setNeedsRedraw(), but ensures the draw will definitely happen even i
f we are not visible. |
| 86 void setNeedsForcedRedraw(); | 88 void setNeedsForcedRedraw(); |
| 87 | 89 |
| 88 void beginFrameComplete(); | 90 void beginFrameComplete(); |
| 89 void beginFrameAborted(); | 91 void beginFrameAborted(); |
| 90 | 92 |
| 91 void setMaxFramesPending(int); | 93 void setMaxFramesPending(int); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 116 scoped_ptr<FrameRateController> m_frameRateController; | 118 scoped_ptr<FrameRateController> m_frameRateController; |
| 117 SchedulerStateMachine m_stateMachine; | 119 SchedulerStateMachine m_stateMachine; |
| 118 bool m_insideProcessScheduledActions; | 120 bool m_insideProcessScheduledActions; |
| 119 | 121 |
| 120 DISALLOW_COPY_AND_ASSIGN(Scheduler); | 122 DISALLOW_COPY_AND_ASSIGN(Scheduler); |
| 121 }; | 123 }; |
| 122 | 124 |
| 123 } // namespace cc | 125 } // namespace cc |
| 124 | 126 |
| 125 #endif // CC_SCHEDULER_H_ | 127 #endif // CC_SCHEDULER_H_ |
| OLD | NEW |