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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
42 virtual void scheduledActionBeginContextRecreation() = 0; | 42 virtual void scheduledActionBeginContextRecreation() = 0; |
43 virtual void scheduledActionAcquireLayerTexturesForMainThread() = 0; | 43 virtual void scheduledActionAcquireLayerTexturesForMainThread() = 0; |
44 virtual void didAnticipatedDrawTimeChange(base::TimeTicks) = 0; | 44 virtual void didAnticipatedDrawTimeChange(base::TimeTicks) = 0; |
45 | 45 |
46 protected: | 46 protected: |
47 virtual ~SchedulerClient() { } | 47 virtual ~SchedulerClient() { } |
48 }; | 48 }; |
49 | 49 |
50 class CC_EXPORT Scheduler : FrameRateControllerClient { | 50 class CC_EXPORT Scheduler : FrameRateControllerClient { |
51 public: | 51 public: |
52 static scoped_ptr<Scheduler> create(SchedulerClient* client, scoped_ptr<Fram eRateController> frameRateController) | 52 static scoped_ptr<Scheduler> create(SchedulerClient* client, scoped_ptr<Fram eRateController> frameRateController, bool implSidePaintingEnabled) |
nduca
2013/01/11 04:07:31
How about passing in the Settings object?
brianderson
2013/01/12 00:38:34
Done.
| |
53 { | 53 { |
54 return make_scoped_ptr(new Scheduler(client, frameRateController.Pass()) ); | 54 return make_scoped_ptr(new Scheduler(client, frameRateController.Pass(), implSidePaintingEnabled)); |
55 } | 55 } |
56 | 56 |
57 virtual ~Scheduler(); | 57 virtual ~Scheduler(); |
58 | 58 |
59 void setCanBeginFrame(bool); | 59 void setCanBeginFrame(bool); |
60 | 60 |
61 void setVisible(bool); | 61 void setVisible(bool); |
62 void setCanDraw(bool); | 62 void setCanDraw(bool); |
63 void setHasPendingTree(bool); | 63 void setHasPendingTree(bool); |
64 | 64 |
(...skipping 23 matching lines...) Expand all Loading... | |
88 bool redrawPending() const { return m_stateMachine.redrawPending(); } | 88 bool redrawPending() const { return m_stateMachine.redrawPending(); } |
89 | 89 |
90 void setTimebaseAndInterval(base::TimeTicks timebase, base::TimeDelta interv al); | 90 void setTimebaseAndInterval(base::TimeTicks timebase, base::TimeDelta interv al); |
91 | 91 |
92 base::TimeTicks anticipatedDrawTime(); | 92 base::TimeTicks anticipatedDrawTime(); |
93 | 93 |
94 // FrameRateControllerClient implementation | 94 // FrameRateControllerClient implementation |
95 virtual void vsyncTick(bool throttled) OVERRIDE; | 95 virtual void vsyncTick(bool throttled) OVERRIDE; |
96 | 96 |
97 private: | 97 private: |
98 Scheduler(SchedulerClient*, scoped_ptr<FrameRateController>); | 98 Scheduler(SchedulerClient*, scoped_ptr<FrameRateController>, bool implSidePa intingEnabled); |
99 | 99 |
100 void processScheduledActions(); | 100 void processScheduledActions(); |
101 | 101 |
102 SchedulerClient* m_client; | 102 SchedulerClient* m_client; |
103 scoped_ptr<FrameRateController> m_frameRateController; | 103 scoped_ptr<FrameRateController> m_frameRateController; |
104 SchedulerStateMachine m_stateMachine; | 104 SchedulerStateMachine m_stateMachine; |
105 bool m_insideProcessScheduledActions; | 105 bool m_insideProcessScheduledActions; |
106 | 106 |
107 DISALLOW_COPY_AND_ASSIGN(Scheduler); | 107 DISALLOW_COPY_AND_ASSIGN(Scheduler); |
108 }; | 108 }; |
109 | 109 |
110 } // namespace cc | 110 } // namespace cc |
111 | 111 |
112 #endif // CC_SCHEDULER_H_ | 112 #endif // CC_SCHEDULER_H_ |
OLD | NEW |