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/logging.h" | 10 #include "base/logging.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 return needs_begin_frames_; | 72 return needs_begin_frames_; |
73 } | 73 } |
74 | 74 |
75 void BeginFrameSourceMixIn::SetNeedsBeginFrames(bool needs_begin_frames) { | 75 void BeginFrameSourceMixIn::SetNeedsBeginFrames(bool needs_begin_frames) { |
76 DEBUG_FRAMES("BeginFrameSourceMixIn::SetNeedsBeginFrames", | 76 DEBUG_FRAMES("BeginFrameSourceMixIn::SetNeedsBeginFrames", |
77 "current state", | 77 "current state", |
78 needs_begin_frames_, | 78 needs_begin_frames_, |
79 "new state", | 79 "new state", |
80 needs_begin_frames); | 80 needs_begin_frames); |
81 if (needs_begin_frames_ != needs_begin_frames) { | 81 if (needs_begin_frames_ != needs_begin_frames) { |
| 82 needs_begin_frames_ = needs_begin_frames; |
82 OnNeedsBeginFramesChange(needs_begin_frames); | 83 OnNeedsBeginFramesChange(needs_begin_frames); |
83 } | 84 } |
84 needs_begin_frames_ = needs_begin_frames; | |
85 } | 85 } |
86 | 86 |
87 void BeginFrameSourceMixIn::AddObserver(BeginFrameObserver* obs) { | 87 void BeginFrameSourceMixIn::AddObserver(BeginFrameObserver* obs) { |
88 DEBUG_FRAMES("BeginFrameSourceMixIn::AddObserver", | 88 DEBUG_FRAMES("BeginFrameSourceMixIn::AddObserver", |
89 "current observer", | 89 "current observer", |
90 observer_, | 90 observer_, |
91 "to add observer", | 91 "to add observer", |
92 obs); | 92 obs); |
93 DCHECK(!observer_); | 93 DCHECK(!observer_); |
94 observer_ = obs; | 94 observer_ = obs; |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 if (!observer_->LastUsedBeginFrameArgs().IsValid()) | 483 if (!observer_->LastUsedBeginFrameArgs().IsValid()) |
484 return true; | 484 return true; |
485 | 485 |
486 // Only allow new args have a *strictly bigger* frame_time value and statisfy | 486 // Only allow new args have a *strictly bigger* frame_time value and statisfy |
487 // minimum interval requirement. | 487 // minimum interval requirement. |
488 return (args.frame_time >= | 488 return (args.frame_time >= |
489 observer_->LastUsedBeginFrameArgs().frame_time + minimum_interval_); | 489 observer_->LastUsedBeginFrameArgs().frame_time + minimum_interval_); |
490 } | 490 } |
491 | 491 |
492 } // namespace cc | 492 } // namespace cc |
OLD | NEW |