summaryrefslogtreecommitdiffstats
path: root/content/browser/android/in_process
diff options
context:
space:
mode:
authordanakj <danakj@chromium.org>2015-09-09 18:18:01 -0700
committerCommit bot <commit-bot@chromium.org>2015-09-10 01:19:01 +0000
commit0481b57b189b48322c09572a601e345febf27e6a (patch)
treebb485e221e0c40bcae983dcebcd00456df577843 /content/browser/android/in_process
parent62df5689bd3075564a86525e291ece2ccc2a0797 (diff)
downloadchromium_src-0481b57b189b48322c09572a601e345febf27e6a.zip
chromium_src-0481b57b189b48322c09572a601e345febf27e6a.tar.gz
chromium_src-0481b57b189b48322c09572a601e345febf27e6a.tar.bz2
input: Avoid a round trip for OnRootLayerDelegatedScrollOffsetChanged.
Currently the SynchronousCompositorImpl knows the offset changed, so it calles the InputHandler (LayerTreeHostImpl) which calls the LayerTreeImpl. Then LayerTreeImpl needs to know the offset, so it calls back to the SynchronousCompositorImpl through the LayerScrollOffsetDelegate. Just pass the offset to OnRootLayerDelegatedScrollOffsetChanged to make this simpler and avoid the anti-pattern of having class A call class B just to have class B get data from class A. R=boliu, jdduke BUG=522658 CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel Review URL: https://codereview.chromium.org/1334573002 Cr-Commit-Position: refs/heads/master@{#348063}
Diffstat (limited to 'content/browser/android/in_process')
-rw-r--r--content/browser/android/in_process/synchronous_compositor_impl.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/content/browser/android/in_process/synchronous_compositor_impl.cc b/content/browser/android/in_process/synchronous_compositor_impl.cc
index a64971e..17c9be8 100644
--- a/content/browser/android/in_process/synchronous_compositor_impl.cc
+++ b/content/browser/android/in_process/synchronous_compositor_impl.cc
@@ -274,8 +274,10 @@ void SynchronousCompositorImpl::PostInvalidate() {
}
void SynchronousCompositorImpl::DidChangeRootLayerScrollOffset() {
- if (input_handler_)
- input_handler_->OnRootLayerDelegatedScrollOffsetChanged();
+ if (!input_handler_)
+ return;
+ gfx::ScrollOffset offset = GetTotalScrollOffset();
+ input_handler_->OnRootLayerDelegatedScrollOffsetChanged(offset);
}
void SynchronousCompositorImpl::SetIsActive(bool is_active) {