| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/surfaces/primary_begin_frame_source.h" | 5 #include "cc/surfaces/primary_begin_frame_source.h" |
| 6 | 6 |
| 7 namespace cc { | 7 namespace cc { |
| 8 | 8 |
| 9 PrimaryBeginFrameSource::PrimaryBeginFrameSource() | 9 PrimaryBeginFrameSource::PrimaryBeginFrameSource() |
| 10 : begin_frame_source_(this) {} | 10 : begin_frame_source_(this) {} |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 begin_frame_source_.OnBeginFrame(args); | 45 begin_frame_source_.OnBeginFrame(args); |
| 46 last_begin_frame_args_ = args; | 46 last_begin_frame_args_ = args; |
| 47 } | 47 } |
| 48 | 48 |
| 49 const BeginFrameArgs& PrimaryBeginFrameSource::LastUsedBeginFrameArgs() const { | 49 const BeginFrameArgs& PrimaryBeginFrameSource::LastUsedBeginFrameArgs() const { |
| 50 return last_begin_frame_args_; | 50 return last_begin_frame_args_; |
| 51 } | 51 } |
| 52 | 52 |
| 53 void PrimaryBeginFrameSource::OnBeginFrameSourcePausedChanged(bool paused) {} | 53 void PrimaryBeginFrameSource::OnBeginFrameSourcePausedChanged(bool paused) {} |
| 54 | 54 |
| 55 void PrimaryBeginFrameSource::DidFinishFrame(BeginFrameObserver* obs, | 55 void PrimaryBeginFrameSource::DidFinishFrame(BeginFrameObserver* obs) { |
| 56 const BeginFrameAck& ack) { | 56 begin_frame_source_.DidFinishFrame(obs); |
| 57 begin_frame_source_.DidFinishFrame(obs, ack); | |
| 58 } | 57 } |
| 59 | 58 |
| 60 void PrimaryBeginFrameSource::AddObserver(BeginFrameObserver* obs) { | 59 void PrimaryBeginFrameSource::AddObserver(BeginFrameObserver* obs) { |
| 61 begin_frame_source_.AddObserver(obs); | 60 begin_frame_source_.AddObserver(obs); |
| 62 } | 61 } |
| 63 | 62 |
| 64 void PrimaryBeginFrameSource::RemoveObserver(BeginFrameObserver* obs) { | 63 void PrimaryBeginFrameSource::RemoveObserver(BeginFrameObserver* obs) { |
| 65 begin_frame_source_.RemoveObserver(obs); | 64 begin_frame_source_.RemoveObserver(obs); |
| 66 } | 65 } |
| 67 | 66 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 78 if (!current_begin_frame_source_) | 77 if (!current_begin_frame_source_) |
| 79 return; | 78 return; |
| 80 | 79 |
| 81 if (needs_begin_frames_) | 80 if (needs_begin_frames_) |
| 82 current_begin_frame_source_->AddObserver(this); | 81 current_begin_frame_source_->AddObserver(this); |
| 83 else | 82 else |
| 84 current_begin_frame_source_->RemoveObserver(this); | 83 current_begin_frame_source_->RemoveObserver(this); |
| 85 } | 84 } |
| 86 | 85 |
| 87 } // namespace cc | 86 } // namespace cc |
| OLD | NEW |