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 "content/renderer/android/synchronous_compositor_external_begin_frame_s
ource.h" | 5 #include "content/renderer/android/synchronous_compositor_external_begin_frame_s
ource.h" |
6 | 6 |
7 #include "cc/output/begin_frame_args.h" | 7 #include "cc/output/begin_frame_args.h" |
8 #include "content/renderer/android/synchronous_compositor_registry.h" | 8 #include "content/renderer/android/synchronous_compositor_registry.h" |
9 | 9 |
10 namespace content { | 10 namespace content { |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 SetBeginFrameSourcePaused(!client_); | 54 SetBeginFrameSourcePaused(!client_); |
55 } | 55 } |
56 | 56 |
57 void SynchronousCompositorExternalBeginFrameSource::OnNeedsBeginFramesChanged( | 57 void SynchronousCompositorExternalBeginFrameSource::OnNeedsBeginFramesChanged( |
58 bool needs_begin_frames) { | 58 bool needs_begin_frames) { |
59 DCHECK(CalledOnValidThread()); | 59 DCHECK(CalledOnValidThread()); |
60 if (client_) | 60 if (client_) |
61 client_->OnNeedsBeginFramesChange(needs_begin_frames); | 61 client_->OnNeedsBeginFramesChange(needs_begin_frames); |
62 } | 62 } |
63 | 63 |
64 void SynchronousCompositorExternalBeginFrameSource::SetClientReady() { | 64 void SynchronousCompositorExternalBeginFrameSource::AddObserver( |
| 65 cc::BeginFrameObserver* obs) { |
65 DCHECK(CalledOnValidThread()); | 66 DCHECK(CalledOnValidThread()); |
| 67 BeginFrameSourceBase::AddObserver(obs); |
| 68 if (registered_) |
| 69 return; |
66 registry_->RegisterBeginFrameSource(routing_id_, this); | 70 registry_->RegisterBeginFrameSource(routing_id_, this); |
67 registered_ = true; | 71 registered_ = true; |
68 } | 72 } |
69 | 73 |
70 bool | 74 bool |
71 SynchronousCompositorExternalBeginFrameSource::CalledOnValidThread() const { | 75 SynchronousCompositorExternalBeginFrameSource::CalledOnValidThread() const { |
72 return thread_checker_.CalledOnValidThread(); | 76 return thread_checker_.CalledOnValidThread(); |
73 } | 77 } |
74 | 78 |
75 } // namespace content | 79 } // namespace content |
OLD | NEW |