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/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/debug/trace_event_argument.h" | 9 #include "base/debug/trace_event_argument.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
407 | 407 |
408 // BeginFrameSource support | 408 // BeginFrameSource support |
409 bool BeginFrameSourceMultiplexer::NeedsBeginFrames() const { | 409 bool BeginFrameSourceMultiplexer::NeedsBeginFrames() const { |
410 if (active_source_) { | 410 if (active_source_) { |
411 return active_source_->NeedsBeginFrames(); | 411 return active_source_->NeedsBeginFrames(); |
412 } else { | 412 } else { |
413 return false; | 413 return false; |
414 } | 414 } |
415 } | 415 } |
416 | 416 |
417 void BeginFrameSourceMultiplexer::SetNeedsBeginFrames(bool needs_begin_frames) { | 417 void BeginFrameSourceMultiplexer::OnNeedsBeginFramesChange( |
418 bool needs_begin_frames) { | |
418 DEBUG_FRAMES("BeginFrameSourceMultiplexer::SetNeedsBeginFrames", | 419 DEBUG_FRAMES("BeginFrameSourceMultiplexer::SetNeedsBeginFrames", |
simonhong
2015/02/03 19:37:55
SetNeedsBeginFrames -> OnNeedsBeginFramesChange.
Jimmy Jo
2015/02/04 01:46:47
Done.
| |
419 "active_source", | 420 "active_source", |
420 active_source_, | 421 active_source_, |
421 "needs_begin_frames", | 422 "needs_begin_frames", |
422 needs_begin_frames); | 423 needs_begin_frames); |
423 if (active_source_) { | 424 if (active_source_) { |
424 active_source_->SetNeedsBeginFrames(needs_begin_frames); | 425 active_source_->SetNeedsBeginFrames(needs_begin_frames); |
425 } else { | 426 } else { |
426 DCHECK(!needs_begin_frames); | 427 DCHECK(!needs_begin_frames); |
427 } | 428 } |
428 } | 429 } |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
483 if (!observer_->LastUsedBeginFrameArgs().IsValid()) | 484 if (!observer_->LastUsedBeginFrameArgs().IsValid()) |
484 return true; | 485 return true; |
485 | 486 |
486 // Only allow new args have a *strictly bigger* frame_time value and statisfy | 487 // Only allow new args have a *strictly bigger* frame_time value and statisfy |
487 // minimum interval requirement. | 488 // minimum interval requirement. |
488 return (args.frame_time >= | 489 return (args.frame_time >= |
489 observer_->LastUsedBeginFrameArgs().frame_time + minimum_interval_); | 490 observer_->LastUsedBeginFrameArgs().frame_time + minimum_interval_); |
490 } | 491 } |
491 | 492 |
492 } // namespace cc | 493 } // namespace cc |
OLD | NEW |