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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 }; | 208 }; |
209 | 209 |
210 // A frame source which is locked to an external parameters provides from a | 210 // A frame source which is locked to an external parameters provides from a |
211 // vsync source and generates BeginFrameArgs for it. | 211 // vsync source and generates BeginFrameArgs for it. |
212 class CC_EXPORT SyntheticBeginFrameSource : public BeginFrameSourceBase, | 212 class CC_EXPORT SyntheticBeginFrameSource : public BeginFrameSourceBase, |
213 public DelayBasedTimeSourceClient { | 213 public DelayBasedTimeSourceClient { |
214 public: | 214 public: |
215 explicit SyntheticBeginFrameSource(base::SingleThreadTaskRunner* task_runner, | 215 explicit SyntheticBeginFrameSource(base::SingleThreadTaskRunner* task_runner, |
216 base::TimeDelta initial_vsync_interval); | 216 base::TimeDelta initial_vsync_interval); |
217 explicit SyntheticBeginFrameSource( | 217 explicit SyntheticBeginFrameSource( |
218 scoped_ptr<DelayBasedTimeSource> time_source); | 218 std::unique_ptr<DelayBasedTimeSource> time_source); |
219 ~SyntheticBeginFrameSource() override; | 219 ~SyntheticBeginFrameSource() override; |
220 | 220 |
221 void OnUpdateVSyncParameters(base::TimeTicks new_vsync_timebase, | 221 void OnUpdateVSyncParameters(base::TimeTicks new_vsync_timebase, |
222 base::TimeDelta new_vsync_interval); | 222 base::TimeDelta new_vsync_interval); |
223 | 223 |
224 // BeginFrameSourceBase | 224 // BeginFrameSourceBase |
225 void AddObserver(BeginFrameObserver* obs) override; | 225 void AddObserver(BeginFrameObserver* obs) override; |
226 void OnNeedsBeginFramesChanged(bool needs_begin_frames) override; | 226 void OnNeedsBeginFramesChanged(bool needs_begin_frames) override; |
227 | 227 |
228 // Tracing | 228 // Tracing |
229 void AsValueInto(base::trace_event::TracedValue* dict) const override; | 229 void AsValueInto(base::trace_event::TracedValue* dict) const override; |
230 | 230 |
231 // DelayBasedTimeSourceClient | 231 // DelayBasedTimeSourceClient |
232 void OnTimerTick() override; | 232 void OnTimerTick() override; |
233 | 233 |
234 protected: | 234 protected: |
235 BeginFrameArgs CreateBeginFrameArgs(base::TimeTicks frame_time, | 235 BeginFrameArgs CreateBeginFrameArgs(base::TimeTicks frame_time, |
236 BeginFrameArgs::BeginFrameArgsType type); | 236 BeginFrameArgs::BeginFrameArgsType type); |
237 | 237 |
238 scoped_ptr<DelayBasedTimeSource> time_source_; | 238 std::unique_ptr<DelayBasedTimeSource> time_source_; |
239 | 239 |
240 private: | 240 private: |
241 DISALLOW_COPY_AND_ASSIGN(SyntheticBeginFrameSource); | 241 DISALLOW_COPY_AND_ASSIGN(SyntheticBeginFrameSource); |
242 }; | 242 }; |
243 | 243 |
244 } // namespace cc | 244 } // namespace cc |
245 | 245 |
246 #endif // CC_SCHEDULER_BEGIN_FRAME_SOURCE_H_ | 246 #endif // CC_SCHEDULER_BEGIN_FRAME_SOURCE_H_ |
OLD | NEW |