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

Issue 1038173002: Refactor delegated scrolling in LayerImpl (Closed)

Created:
5 years, 9 months ago by hush (inactive)
Modified:
5 years, 8 months ago
CC:
bokan, boliu, cc-bugs_chromium.org, chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Refactor delegated scrolling in LayerImpl When the root layer scroll offset delegate's scroll offset is bigger than that of the outer viewport scroll layer, the root scroll offset is distributed between inner and outer viewport scroll layer. However, the layer that gets assigned a new scroll offset first will immediately update the root layer delegate scroll offset without waiting for the rest of the undistributed scrolls to be assigned to other layer. This causes the associated bug 470360. This CL simplified the logic around delegated scrolling by removing LayerImpl::ScrollOffsetDelegate. LayerImpl will always have the most recent and correct scroll offset. LTHI and LTI still delegate the root layer scroll to an external source (Android WebView). There are 2 cases for a LayerImpl to change its scroll offset: 1. When the root layer scroll delegate scrolls, the new scroll offset will be synchronously distributed to the inner and outer viewport scroll layer. 2. The LayerImpl scrolls by itself, like ScrollBy() or PushScrollOffset(). In this case, root layer scroll delegate will be updated with the new scroll offset. BUG=470360 Committed: https://crrev.com/33370e19d3c6a43d0cb7c87f90aadb79d44dd741 Cr-Commit-Position: refs/heads/master@{#324012}

Patch Set 1 : wip #

Patch Set 2 : block_updates #

Patch Set 3 : test #

Patch Set 4 : test #

Patch Set 5 : test #

Patch Set 6 : format #

Total comments: 2

Patch Set 7 : comments #

Patch Set 8 : Remove "scrollOffsetDelegate" #

Total comments: 6

Patch Set 9 : comments #

Total comments: 3

Patch Set 10 : address comments + fix test #

Patch Set 11 : remove the extra state in LTI for real.. #

Patch Set 12 : #

Patch Set 13 : Added a new test for Inner/Outer viewport scrolling #

Unified diffs Side-by-side diffs Delta from patch set Stats (+161 lines, -375 lines) Patch
M cc/layers/layer_impl.h View 1 2 3 4 5 6 7 8 9 4 chunks +6 lines, -14 lines 0 comments Download
M cc/layers/layer_impl.cc View 1 2 3 4 5 6 7 8 9 8 chunks +13 lines, -37 lines 0 comments Download
M cc/layers/layer_impl_unittest.cc View 1 2 3 4 5 6 7 2 chunks +1 line, -157 lines 0 comments Download
M cc/trees/layer_tree_host_impl.cc View 1 2 3 4 5 6 7 1 chunk +1 line, -1 line 0 comments Download
M cc/trees/layer_tree_host_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 8 chunks +82 lines, -21 lines 0 comments Download
M cc/trees/layer_tree_impl.h View 1 2 3 4 5 6 7 8 9 10 4 chunks +9 lines, -8 lines 0 comments Download
M cc/trees/layer_tree_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 9 chunks +49 lines, -137 lines 0 comments Download

Messages

Total messages: 20 (6 generated)
hush (inactive)
looks like things are pretty intertwined... a bunch of Android WebView tests are broken.
5 years, 9 months ago (2015-03-26 23:25:20 UTC) #1
hush (inactive)
Hi Alex, PTAL PS6. I added some extra logic to make sure the root layer ...
5 years, 8 months ago (2015-03-30 22:50:52 UTC) #5
aelias_OOO_until_Jul13
https://codereview.chromium.org/1038173002/diff/140001/content/browser/android/in_process/synchronous_compositor_impl.h File content/browser/android/in_process/synchronous_compositor_impl.h (right): https://codereview.chromium.org/1038173002/diff/140001/content/browser/android/in_process/synchronous_compositor_impl.h#newcode111 content/browser/android/in_process/synchronous_compositor_impl.h:111: bool block_updates_; Nobody ever reads this value, is there ...
5 years, 8 months ago (2015-03-30 22:54:40 UTC) #6
hush (inactive)
https://codereview.chromium.org/1038173002/diff/140001/content/browser/android/in_process/synchronous_compositor_impl.h File content/browser/android/in_process/synchronous_compositor_impl.h (right): https://codereview.chromium.org/1038173002/diff/140001/content/browser/android/in_process/synchronous_compositor_impl.h#newcode111 content/browser/android/in_process/synchronous_compositor_impl.h:111: bool block_updates_; On 2015/03/30 22:54:39, aelias wrote: > Nobody ...
5 years, 8 months ago (2015-03-30 23:00:44 UTC) #7
hush (inactive)
Hi Alex! PS8: I think it is not necessary for LayerImpl to support delegated scrolling. ...
5 years, 8 months ago (2015-04-06 18:06:28 UTC) #9
aelias_OOO_until_Jul13
This looks like a great direction, I like it. I agree LayerImpl having the logic ...
5 years, 8 months ago (2015-04-06 19:47:49 UTC) #10
aelias_OOO_until_Jul13
https://codereview.chromium.org/1038173002/diff/200001/cc/trees/layer_tree_impl.cc File cc/trees/layer_tree_impl.cc (right): https://codereview.chromium.org/1038173002/diff/200001/cc/trees/layer_tree_impl.cc#newcode1081 cc/trees/layer_tree_impl.cc:1081: if (!OuterViewportScrollLayer()) { You can delete this block and ...
5 years, 8 months ago (2015-04-06 19:57:32 UTC) #11
hush (inactive)
https://codereview.chromium.org/1038173002/diff/200001/cc/layers/layer_impl.h File cc/layers/layer_impl.h (right): https://codereview.chromium.org/1038173002/diff/200001/cc/layers/layer_impl.h#newcode86 cc/layers/layer_impl.h:86: class ExternalScrollOffsetListener { On 2015/04/06 19:47:49, aelias wrote: > ...
5 years, 8 months ago (2015-04-06 23:08:04 UTC) #12
aelias_OOO_until_Jul13
Looking good. Please update the patch description. https://codereview.chromium.org/1038173002/diff/220001/cc/trees/layer_tree_impl.cc File cc/trees/layer_tree_impl.cc (right): https://codereview.chromium.org/1038173002/diff/220001/cc/trees/layer_tree_impl.cc#newcode1026 cc/trees/layer_tree_impl.cc:1026: base::AutoReset<bool> is_distributing_root_scroll_auto_reset( ...
5 years, 8 months ago (2015-04-07 00:52:20 UTC) #13
hush (inactive)
https://codereview.chromium.org/1038173002/diff/220001/cc/trees/layer_tree_impl.cc File cc/trees/layer_tree_impl.cc (right): https://codereview.chromium.org/1038173002/diff/220001/cc/trees/layer_tree_impl.cc#newcode1026 cc/trees/layer_tree_impl.cc:1026: base::AutoReset<bool> is_distributing_root_scroll_auto_reset( On 2015/04/07 00:52:20, aelias wrote: > Could ...
5 years, 8 months ago (2015-04-07 01:29:08 UTC) #14
aelias_OOO_until_Jul13
lgtm. Please update the CL description to reflect the current approach before you land.
5 years, 8 months ago (2015-04-07 02:10:17 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1038173002/300001
5 years, 8 months ago (2015-04-07 02:58:52 UTC) #18
commit-bot: I haz the power
Committed patchset #13 (id:300001)
5 years, 8 months ago (2015-04-07 03:50:02 UTC) #19
commit-bot: I haz the power
5 years, 8 months ago (2015-04-07 03:50:51 UTC) #20
Message was sent while issue was closed.
Patchset 13 (id:??) landed as
https://crrev.com/33370e19d3c6a43d0cb7c87f90aadb79d44dd741
Cr-Commit-Position: refs/heads/master@{#324012}

Powered by Google App Engine
This is Rietveld 408576698