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 #include "cc/scheduler/begin_frame_source.h" | 5 #include "cc/scheduler/begin_frame_source.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 // SyntheticBeginFrameSource --------------------------------------------- | 190 // SyntheticBeginFrameSource --------------------------------------------- |
191 SyntheticBeginFrameSource::SyntheticBeginFrameSource( | 191 SyntheticBeginFrameSource::SyntheticBeginFrameSource( |
192 base::SingleThreadTaskRunner* task_runner, | 192 base::SingleThreadTaskRunner* task_runner, |
193 base::TimeDelta initial_vsync_interval) | 193 base::TimeDelta initial_vsync_interval) |
194 : time_source_( | 194 : time_source_( |
195 DelayBasedTimeSource::Create(initial_vsync_interval, task_runner)) { | 195 DelayBasedTimeSource::Create(initial_vsync_interval, task_runner)) { |
196 time_source_->SetClient(this); | 196 time_source_->SetClient(this); |
197 } | 197 } |
198 | 198 |
199 SyntheticBeginFrameSource::SyntheticBeginFrameSource( | 199 SyntheticBeginFrameSource::SyntheticBeginFrameSource( |
200 scoped_ptr<DelayBasedTimeSource> time_source) | 200 std::unique_ptr<DelayBasedTimeSource> time_source) |
201 : time_source_(std::move(time_source)) { | 201 : time_source_(std::move(time_source)) { |
202 time_source_->SetClient(this); | 202 time_source_->SetClient(this); |
203 } | 203 } |
204 | 204 |
205 SyntheticBeginFrameSource::~SyntheticBeginFrameSource() {} | 205 SyntheticBeginFrameSource::~SyntheticBeginFrameSource() {} |
206 | 206 |
207 void SyntheticBeginFrameSource::OnUpdateVSyncParameters( | 207 void SyntheticBeginFrameSource::OnUpdateVSyncParameters( |
208 base::TimeTicks new_vsync_timebase, | 208 base::TimeTicks new_vsync_timebase, |
209 base::TimeDelta new_vsync_interval) { | 209 base::TimeDelta new_vsync_interval) { |
210 time_source_->SetTimebaseAndInterval(new_vsync_timebase, new_vsync_interval); | 210 time_source_->SetTimebaseAndInterval(new_vsync_timebase, new_vsync_interval); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 base::trace_event::TracedValue* dict) const { | 257 base::trace_event::TracedValue* dict) const { |
258 dict->SetString("type", "SyntheticBeginFrameSource"); | 258 dict->SetString("type", "SyntheticBeginFrameSource"); |
259 BeginFrameSourceBase::AsValueInto(dict); | 259 BeginFrameSourceBase::AsValueInto(dict); |
260 | 260 |
261 dict->BeginDictionary("time_source"); | 261 dict->BeginDictionary("time_source"); |
262 time_source_->AsValueInto(dict); | 262 time_source_->AsValueInto(dict); |
263 dict->EndDictionary(); | 263 dict->EndDictionary(); |
264 } | 264 } |
265 | 265 |
266 } // namespace cc | 266 } // namespace cc |
OLD | NEW |