Chromium Code Reviews| 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 "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 321 | 321 |
| 322 gfx::ScrollOffset SynchronousCompositorImpl::GetTotalScrollOffset() { | 322 gfx::ScrollOffset SynchronousCompositorImpl::GetTotalScrollOffset() { |
| 323 DCHECK(CalledOnValidThread()); | 323 DCHECK(CalledOnValidThread()); |
| 324 DCHECK(compositor_client_); | 324 DCHECK(compositor_client_); |
| 325 // TODO(miletus): Make GetTotalRootLayerScrollOffset return | 325 // TODO(miletus): Make GetTotalRootLayerScrollOffset return |
| 326 // ScrollOffset. crbug.com/414283. | 326 // ScrollOffset. crbug.com/414283. |
| 327 return gfx::ScrollOffset( | 327 return gfx::ScrollOffset( |
| 328 compositor_client_->GetTotalRootLayerScrollOffset()); | 328 compositor_client_->GetTotalRootLayerScrollOffset()); |
| 329 } | 329 } |
| 330 | 330 |
| 331 bool SynchronousCompositorImpl::IsExternalFlingActive() const { | 331 bool SynchronousCompositorImpl::IsExternalScrollActive() const { |
| 332 DCHECK(CalledOnValidThread()); | 332 DCHECK(CalledOnValidThread()); |
| 333 DCHECK(compositor_client_); | 333 DCHECK(compositor_client_); |
| 334 return compositor_client_->IsExternalFlingActive(); | 334 return compositor_client_->IsExternalScrollActive(); |
| 335 } | |
| 336 | |
| 337 void SynchronousCompositorImpl::SetNeedsAnimate( | |
| 338 const AnimationCallback& animation) { | |
| 339 DCHECK(CalledOnValidThread()); | |
| 340 if (compositor_client_) | |
|
boliu
2015/05/29 19:42:47
This is a call from cc, right? In that case, DCHEC
hush (inactive)
2015/06/05 21:47:22
Yes. This is a new function added to LayerScrollOf
| |
| 341 compositor_client_->SetNeedsAnimateScroll(animation); | |
| 335 } | 342 } |
| 336 | 343 |
| 337 void SynchronousCompositorImpl::UpdateRootLayerState( | 344 void SynchronousCompositorImpl::UpdateRootLayerState( |
| 338 const gfx::ScrollOffset& total_scroll_offset, | 345 const gfx::ScrollOffset& total_scroll_offset, |
| 339 const gfx::ScrollOffset& max_scroll_offset, | 346 const gfx::ScrollOffset& max_scroll_offset, |
| 340 const gfx::SizeF& scrollable_size, | 347 const gfx::SizeF& scrollable_size, |
| 341 float page_scale_factor, | 348 float page_scale_factor, |
| 342 float min_page_scale_factor, | 349 float min_page_scale_factor, |
| 343 float max_page_scale_factor) { | 350 float max_page_scale_factor) { |
| 344 DCHECK(CalledOnValidThread()); | 351 DCHECK(CalledOnValidThread()); |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 369 g_factory.Get(); // Ensure it's initialized. | 376 g_factory.Get(); // Ensure it's initialized. |
| 370 SynchronousCompositorImpl::CreateForWebContents(contents); | 377 SynchronousCompositorImpl::CreateForWebContents(contents); |
| 371 } | 378 } |
| 372 SynchronousCompositorImpl* instance = | 379 SynchronousCompositorImpl* instance = |
| 373 SynchronousCompositorImpl::FromWebContents(contents); | 380 SynchronousCompositorImpl::FromWebContents(contents); |
| 374 DCHECK(instance); | 381 DCHECK(instance); |
| 375 instance->SetClient(client); | 382 instance->SetClient(client); |
| 376 } | 383 } |
| 377 | 384 |
| 378 } // namespace content | 385 } // namespace content |
| OLD | NEW |