OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/browser/android/in_process/synchronous_compositor_impl.h" | 5 #include "content/browser/android/in_process/synchronous_compositor_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 is_active); | 246 is_active); |
247 if (is_active_ == is_active) | 247 if (is_active_ == is_active) |
248 return; | 248 return; |
249 | 249 |
250 is_active_ = is_active; | 250 is_active_ = is_active; |
251 UpdateNeedsBeginFrames(); | 251 UpdateNeedsBeginFrames(); |
252 if (begin_frame_source_) | 252 if (begin_frame_source_) |
253 begin_frame_source_->SetBeginFrameSourcePaused(!is_active_); | 253 begin_frame_source_->SetBeginFrameSourcePaused(!is_active_); |
254 } | 254 } |
255 | 255 |
| 256 void SynchronousCompositorImpl::SynchronizeWithRenderer() { |
| 257 // Intentional no-op. Nothing to synchronize. |
| 258 } |
| 259 |
256 void SynchronousCompositorImpl::OnComputeScroll( | 260 void SynchronousCompositorImpl::OnComputeScroll( |
257 base::TimeTicks animation_time) { | 261 base::TimeTicks animation_time) { |
258 if (need_animate_input_) { | 262 if (need_animate_input_) { |
259 need_animate_input_ = false; | 263 need_animate_input_ = false; |
260 synchronous_input_handler_proxy_->SynchronouslyAnimate(animation_time); | 264 synchronous_input_handler_proxy_->SynchronouslyAnimate(animation_time); |
261 } | 265 } |
262 } | 266 } |
263 | 267 |
264 void SynchronousCompositorImpl::OnNeedsBeginFramesChange( | 268 void SynchronousCompositorImpl::OnNeedsBeginFramesChange( |
265 bool needs_begin_frames) { | 269 bool needs_begin_frames) { |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 } | 373 } |
370 } | 374 } |
371 | 375 |
372 // Not using base::NonThreadSafe as we want to enforce a more exacting threading | 376 // Not using base::NonThreadSafe as we want to enforce a more exacting threading |
373 // requirement: SynchronousCompositorImpl() must only be used on the UI thread. | 377 // requirement: SynchronousCompositorImpl() must only be used on the UI thread. |
374 bool SynchronousCompositorImpl::CalledOnValidThread() const { | 378 bool SynchronousCompositorImpl::CalledOnValidThread() const { |
375 return BrowserThread::CurrentlyOn(BrowserThread::UI); | 379 return BrowserThread::CurrentlyOn(BrowserThread::UI); |
376 } | 380 } |
377 | 381 |
378 } // namespace content | 382 } // namespace content |
OLD | NEW |