| 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/atomic_sequence_num.h" | 9 #include "base/atomic_sequence_num.h" |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 } | 330 } |
| 331 } | 331 } |
| 332 | 332 |
| 333 BeginFrameArgs ExternalBeginFrameSource::GetMissedBeginFrameArgs( | 333 BeginFrameArgs ExternalBeginFrameSource::GetMissedBeginFrameArgs( |
| 334 BeginFrameObserver* obs) { | 334 BeginFrameObserver* obs) { |
| 335 if (!last_begin_frame_args_.IsValid()) | 335 if (!last_begin_frame_args_.IsValid()) |
| 336 return BeginFrameArgs(); | 336 return BeginFrameArgs(); |
| 337 | 337 |
| 338 const BeginFrameArgs& last_args = obs->LastUsedBeginFrameArgs(); | 338 const BeginFrameArgs& last_args = obs->LastUsedBeginFrameArgs(); |
| 339 if (last_args.IsValid() && | 339 if (last_args.IsValid() && |
| 340 last_begin_frame_args_.frame_time == last_args.frame_time) { | 340 last_begin_frame_args_.frame_time <= last_args.frame_time) { |
| 341 return BeginFrameArgs(); | 341 return BeginFrameArgs(); |
| 342 } | 342 } |
| 343 | 343 |
| 344 DCHECK((last_begin_frame_args_.source_id != last_args.source_id) || | 344 DCHECK((last_begin_frame_args_.source_id != last_args.source_id) || |
| 345 (last_begin_frame_args_.sequence_number > last_args.sequence_number)) | 345 (last_begin_frame_args_.sequence_number > last_args.sequence_number)) |
| 346 << "current " << last_begin_frame_args_.AsValue()->ToString() << ", last " | 346 << "current " << last_begin_frame_args_.AsValue()->ToString() << ", last " |
| 347 << last_args.AsValue()->ToString(); | 347 << last_args.AsValue()->ToString(); |
| 348 BeginFrameArgs missed_args = last_begin_frame_args_; | 348 BeginFrameArgs missed_args = last_begin_frame_args_; |
| 349 missed_args.type = BeginFrameArgs::MISSED; | 349 missed_args.type = BeginFrameArgs::MISSED; |
| 350 return missed_args; | 350 return missed_args; |
| 351 } | 351 } |
| 352 | 352 |
| 353 } // namespace cc | 353 } // namespace cc |
| OLD | NEW |