OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_BEGIN_FRAME_SOURCE_H_ | 5 #ifndef CC_SCHEDULER_BEGIN_FRAME_SOURCE_H_ |
6 #define CC_SCHEDULER_BEGIN_FRAME_SOURCE_H_ | 6 #define CC_SCHEDULER_BEGIN_FRAME_SOURCE_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 | 200 |
201 private: | 201 private: |
202 base::WeakPtrFactory<BackToBackBeginFrameSource> weak_factory_; | 202 base::WeakPtrFactory<BackToBackBeginFrameSource> weak_factory_; |
203 | 203 |
204 DISALLOW_COPY_AND_ASSIGN(BackToBackBeginFrameSource); | 204 DISALLOW_COPY_AND_ASSIGN(BackToBackBeginFrameSource); |
205 }; | 205 }; |
206 | 206 |
207 // A frame source which is locked to an external parameters provides from a | 207 // A frame source which is locked to an external parameters provides from a |
208 // vsync source and generates BeginFrameArgs for it. | 208 // vsync source and generates BeginFrameArgs for it. |
209 class CC_EXPORT SyntheticBeginFrameSource : public BeginFrameSourceBase, | 209 class CC_EXPORT SyntheticBeginFrameSource : public BeginFrameSourceBase, |
210 public TimeSourceClient { | 210 public DelayBasedTimeSourceClient { |
211 public: | 211 public: |
212 static scoped_ptr<SyntheticBeginFrameSource> Create( | 212 static scoped_ptr<SyntheticBeginFrameSource> Create( |
213 base::SingleThreadTaskRunner* task_runner, | 213 base::SingleThreadTaskRunner* task_runner, |
214 base::TimeDelta initial_vsync_interval); | 214 base::TimeDelta initial_vsync_interval); |
215 ~SyntheticBeginFrameSource() override; | 215 ~SyntheticBeginFrameSource() override; |
216 | 216 |
217 void OnUpdateVSyncParameters(base::TimeTicks new_vsync_timebase, | 217 void OnUpdateVSyncParameters(base::TimeTicks new_vsync_timebase, |
218 base::TimeDelta new_vsync_interval); | 218 base::TimeDelta new_vsync_interval); |
219 | 219 |
220 // Tracing | 220 // Tracing |
221 void AsValueInto(base::trace_event::TracedValue* dict) const override; | 221 void AsValueInto(base::trace_event::TracedValue* dict) const override; |
222 | 222 |
223 // TimeSourceClient | 223 // DelayBasedTimeSourceClient |
224 void OnTimerTick() override; | 224 void OnTimerTick() override; |
225 | 225 |
226 protected: | 226 protected: |
227 explicit SyntheticBeginFrameSource( | 227 explicit SyntheticBeginFrameSource( |
228 scoped_ptr<DelayBasedTimeSource> time_source); | 228 scoped_ptr<DelayBasedTimeSource> time_source); |
229 | 229 |
230 BeginFrameArgs CreateBeginFrameArgs(base::TimeTicks frame_time, | 230 BeginFrameArgs CreateBeginFrameArgs(base::TimeTicks frame_time, |
231 BeginFrameArgs::BeginFrameArgsType type); | 231 BeginFrameArgs::BeginFrameArgsType type); |
232 | 232 |
233 // BeginFrameSourceBase | 233 // BeginFrameSourceBase |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 BeginFrameSource* active_source_; | 283 BeginFrameSource* active_source_; |
284 std::set<BeginFrameSource*> source_list_; | 284 std::set<BeginFrameSource*> source_list_; |
285 | 285 |
286 private: | 286 private: |
287 DISALLOW_COPY_AND_ASSIGN(BeginFrameSourceMultiplexer); | 287 DISALLOW_COPY_AND_ASSIGN(BeginFrameSourceMultiplexer); |
288 }; | 288 }; |
289 | 289 |
290 } // namespace cc | 290 } // namespace cc |
291 | 291 |
292 #endif // CC_SCHEDULER_BEGIN_FRAME_SOURCE_H_ | 292 #endif // CC_SCHEDULER_BEGIN_FRAME_SOURCE_H_ |
OLD | NEW |