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 "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 void BackToBackBeginFrameSource::AsValueInto( | 200 void BackToBackBeginFrameSource::AsValueInto( |
201 base::trace_event::TracedValue* dict) const { | 201 base::trace_event::TracedValue* dict) const { |
202 dict->SetString("type", "BackToBackBeginFrameSource"); | 202 dict->SetString("type", "BackToBackBeginFrameSource"); |
203 BeginFrameSourceBase::AsValueInto(dict); | 203 BeginFrameSourceBase::AsValueInto(dict); |
204 dict->SetBoolean("send_begin_frame_posted_", send_begin_frame_posted_); | 204 dict->SetBoolean("send_begin_frame_posted_", send_begin_frame_posted_); |
205 } | 205 } |
206 | 206 |
207 // SyntheticBeginFrameSource --------------------------------------------- | 207 // SyntheticBeginFrameSource --------------------------------------------- |
208 scoped_ptr<SyntheticBeginFrameSource> SyntheticBeginFrameSource::Create( | 208 scoped_ptr<SyntheticBeginFrameSource> SyntheticBeginFrameSource::Create( |
209 base::SingleThreadTaskRunner* task_runner, | 209 base::SingleThreadTaskRunner* task_runner, |
210 base::TimeTicks initial_vsync_timebase, | |
211 base::TimeDelta initial_vsync_interval) { | 210 base::TimeDelta initial_vsync_interval) { |
212 scoped_refptr<DelayBasedTimeSource> time_source; | 211 scoped_refptr<DelayBasedTimeSource> time_source; |
213 time_source = | 212 time_source = |
214 DelayBasedTimeSource::Create(initial_vsync_interval, task_runner); | 213 DelayBasedTimeSource::Create(initial_vsync_interval, task_runner); |
215 return make_scoped_ptr(new SyntheticBeginFrameSource(time_source)); | 214 return make_scoped_ptr(new SyntheticBeginFrameSource(time_source)); |
216 } | 215 } |
217 | 216 |
218 SyntheticBeginFrameSource::SyntheticBeginFrameSource( | 217 SyntheticBeginFrameSource::SyntheticBeginFrameSource( |
219 scoped_refptr<DelayBasedTimeSource> time_source) | 218 scoped_refptr<DelayBasedTimeSource> time_source) |
220 : BeginFrameSourceBase(), time_source_(time_source) { | 219 : BeginFrameSourceBase(), time_source_(time_source) { |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 if (!observer_->LastUsedBeginFrameArgs().IsValid()) | 461 if (!observer_->LastUsedBeginFrameArgs().IsValid()) |
463 return true; | 462 return true; |
464 | 463 |
465 // Only allow new args have a *strictly bigger* frame_time value and statisfy | 464 // Only allow new args have a *strictly bigger* frame_time value and statisfy |
466 // minimum interval requirement. | 465 // minimum interval requirement. |
467 return (args.frame_time >= | 466 return (args.frame_time >= |
468 observer_->LastUsedBeginFrameArgs().frame_time + minimum_interval_); | 467 observer_->LastUsedBeginFrameArgs().frame_time + minimum_interval_); |
469 } | 468 } |
470 | 469 |
471 } // namespace cc | 470 } // namespace cc |
OLD | NEW |