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 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 DEBUG_FRAMES("BeginFrameSourceMultiplexer::SetNeedsBeginFrames", | 418 bool needs_begin_frames) { |
419 "active_source", | 419 DEBUG_FRAMES("BeginFrameSourceMultiplexer::OnNeedsBeginFramesChange", |
420 active_source_, | 420 "active_source", active_source_, "needs_begin_frames", |
421 "needs_begin_frames", | |
422 needs_begin_frames); | 421 needs_begin_frames); |
423 if (active_source_) { | 422 if (active_source_) { |
424 active_source_->SetNeedsBeginFrames(needs_begin_frames); | 423 active_source_->SetNeedsBeginFrames(needs_begin_frames); |
425 } else { | 424 } else { |
426 DCHECK(!needs_begin_frames); | 425 DCHECK(!needs_begin_frames); |
427 } | 426 } |
428 } | 427 } |
429 | 428 |
430 void BeginFrameSourceMultiplexer::DidFinishFrame(size_t remaining_frames) { | 429 void BeginFrameSourceMultiplexer::DidFinishFrame(size_t remaining_frames) { |
431 DEBUG_FRAMES("BeginFrameSourceMultiplexer::DidFinishFrame", | 430 DEBUG_FRAMES("BeginFrameSourceMultiplexer::DidFinishFrame", |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 if (!observer_->LastUsedBeginFrameArgs().IsValid()) | 482 if (!observer_->LastUsedBeginFrameArgs().IsValid()) |
484 return true; | 483 return true; |
485 | 484 |
486 // Only allow new args have a *strictly bigger* frame_time value and statisfy | 485 // Only allow new args have a *strictly bigger* frame_time value and statisfy |
487 // minimum interval requirement. | 486 // minimum interval requirement. |
488 return (args.frame_time >= | 487 return (args.frame_time >= |
489 observer_->LastUsedBeginFrameArgs().frame_time + minimum_interval_); | 488 observer_->LastUsedBeginFrameArgs().frame_time + minimum_interval_); |
490 } | 489 } |
491 | 490 |
492 } // namespace cc | 491 } // namespace cc |
OLD | NEW |