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 <memory> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 28 matching lines...) Expand all Loading... |
39 virtual void ScheduledActionSendBeginMainFrame( | 39 virtual void ScheduledActionSendBeginMainFrame( |
40 const BeginFrameArgs& args) = 0; | 40 const BeginFrameArgs& args) = 0; |
41 virtual DrawResult ScheduledActionDrawAndSwapIfPossible() = 0; | 41 virtual DrawResult ScheduledActionDrawAndSwapIfPossible() = 0; |
42 virtual DrawResult ScheduledActionDrawAndSwapForced() = 0; | 42 virtual DrawResult ScheduledActionDrawAndSwapForced() = 0; |
43 virtual void ScheduledActionCommit() = 0; | 43 virtual void ScheduledActionCommit() = 0; |
44 virtual void ScheduledActionActivateSyncTree() = 0; | 44 virtual void ScheduledActionActivateSyncTree() = 0; |
45 virtual void ScheduledActionBeginOutputSurfaceCreation() = 0; | 45 virtual void ScheduledActionBeginOutputSurfaceCreation() = 0; |
46 virtual void ScheduledActionPrepareTiles() = 0; | 46 virtual void ScheduledActionPrepareTiles() = 0; |
47 virtual void ScheduledActionInvalidateOutputSurface() = 0; | 47 virtual void ScheduledActionInvalidateOutputSurface() = 0; |
48 virtual void DidFinishImplFrame() = 0; | 48 virtual void DidFinishImplFrame() = 0; |
49 virtual void SendBeginFramesToChildren(const BeginFrameArgs& args) = 0; | |
50 virtual void SendBeginMainFrameNotExpectedSoon() = 0; | 49 virtual void SendBeginMainFrameNotExpectedSoon() = 0; |
51 | 50 |
52 protected: | 51 protected: |
53 virtual ~SchedulerClient() {} | 52 virtual ~SchedulerClient() {} |
54 }; | 53 }; |
55 | 54 |
56 class CC_EXPORT Scheduler : public BeginFrameObserverBase { | 55 class CC_EXPORT Scheduler : public BeginFrameObserverBase { |
57 public: | 56 public: |
58 static std::unique_ptr<Scheduler> Create( | 57 static std::unique_ptr<Scheduler> Create( |
59 SchedulerClient* client, | 58 SchedulerClient* client, |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 // scheduling or statistics purposes. | 130 // scheduling or statistics purposes. |
132 void NotifyBeginMainFrameStarted(base::TimeTicks main_thread_start_time); | 131 void NotifyBeginMainFrameStarted(base::TimeTicks main_thread_start_time); |
133 | 132 |
134 base::TimeTicks LastBeginImplFrameTime(); | 133 base::TimeTicks LastBeginImplFrameTime(); |
135 | 134 |
136 void SetDeferCommits(bool defer_commits); | 135 void SetDeferCommits(bool defer_commits); |
137 | 136 |
138 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> AsValue() const; | 137 std::unique_ptr<base::trace_event::ConvertableToTraceFormat> AsValue() const; |
139 void AsValueInto(base::trace_event::TracedValue* value) const override; | 138 void AsValueInto(base::trace_event::TracedValue* value) const override; |
140 | 139 |
141 void SetChildrenNeedBeginFrames(bool children_need_begin_frames); | |
142 void SetVideoNeedsBeginFrames(bool video_needs_begin_frames); | 140 void SetVideoNeedsBeginFrames(bool video_needs_begin_frames); |
143 | 141 |
144 const BeginFrameSource* begin_frame_source() const { | 142 const BeginFrameSource* begin_frame_source() const { |
145 return begin_frame_source_; | 143 return begin_frame_source_; |
146 } | 144 } |
147 | 145 |
148 protected: | 146 protected: |
149 Scheduler(SchedulerClient* client, | 147 Scheduler(SchedulerClient* client, |
150 const SchedulerSettings& scheduler_settings, | 148 const SchedulerSettings& scheduler_settings, |
151 int layer_tree_host_id, | 149 int layer_tree_host_id, |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 } | 218 } |
221 | 219 |
222 base::WeakPtrFactory<Scheduler> weak_factory_; | 220 base::WeakPtrFactory<Scheduler> weak_factory_; |
223 | 221 |
224 DISALLOW_COPY_AND_ASSIGN(Scheduler); | 222 DISALLOW_COPY_AND_ASSIGN(Scheduler); |
225 }; | 223 }; |
226 | 224 |
227 } // namespace cc | 225 } // namespace cc |
228 | 226 |
229 #endif // CC_SCHEDULER_SCHEDULER_H_ | 227 #endif // CC_SCHEDULER_SCHEDULER_H_ |
OLD | NEW |