Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Side by Side Diff: content/browser/android/in_process/synchronous_compositor_impl.cc

Issue 1251323002: Plumb smooth scrolling in Chromium compositor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use a blink page scale animation Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 DCHECK(CalledOnValidThread()); 351 DCHECK(CalledOnValidThread());
352 DCHECK(compositor_client_); 352 DCHECK(compositor_client_);
353 if (!registered_with_client_) 353 if (!registered_with_client_)
354 return gfx::ScrollOffset(); 354 return gfx::ScrollOffset();
355 // TODO(miletus): Make GetTotalRootLayerScrollOffset return 355 // TODO(miletus): Make GetTotalRootLayerScrollOffset return
356 // ScrollOffset. crbug.com/414283. 356 // ScrollOffset. crbug.com/414283.
357 return gfx::ScrollOffset( 357 return gfx::ScrollOffset(
358 compositor_client_->GetTotalRootLayerScrollOffset()); 358 compositor_client_->GetTotalRootLayerScrollOffset());
359 } 359 }
360 360
361 bool SynchronousCompositorImpl::IsExternalScrollActive() const {
362 DCHECK(CalledOnValidThread());
363 DCHECK(compositor_client_);
364 if (!registered_with_client_)
365 return false;
366 return compositor_client_->IsExternalScrollActive();
367 }
368
369 void SynchronousCompositorImpl::SetNeedsAnimate( 361 void SynchronousCompositorImpl::SetNeedsAnimate(
370 const AnimationCallback& animation) { 362 const AnimationCallback& animation) {
371 DCHECK(CalledOnValidThread()); 363 DCHECK(CalledOnValidThread());
372 DCHECK(compositor_client_); 364 DCHECK(compositor_client_);
373 if (!registered_with_client_) 365 if (!registered_with_client_)
374 return; 366 return;
375 compositor_client_->SetNeedsAnimateScroll(animation); 367 compositor_client_->SetNeedsAnimateScroll(animation);
376 } 368 }
377 369
378 void SynchronousCompositorImpl::UpdateRootLayerState( 370 void SynchronousCompositorImpl::UpdateRootLayerState(
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 g_factory.Get(); // Ensure it's initialized. 404 g_factory.Get(); // Ensure it's initialized.
413 SynchronousCompositorImpl::CreateForWebContents(contents); 405 SynchronousCompositorImpl::CreateForWebContents(contents);
414 } 406 }
415 SynchronousCompositorImpl* instance = 407 SynchronousCompositorImpl* instance =
416 SynchronousCompositorImpl::FromWebContents(contents); 408 SynchronousCompositorImpl::FromWebContents(contents);
417 DCHECK(instance); 409 DCHECK(instance);
418 instance->SetClient(client); 410 instance->SetClient(client);
419 } 411 }
420 412
421 } // namespace content 413 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698