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

Issue 511253003: Made Blink aware of top controls offset (Chromium-side) (Closed)

Created:
6 years, 3 months ago by bokan
Modified:
6 years, 3 months ago
CC:
cc-bugs_chromium.org, chromium-reviews, danakj+watch_chromium.org, darin-cc_chromium.org, jam, jbauman+watch_chromium.org, kalyank, piman+watch_chromium.org, sievers+watch_chromium.org, Ian Vollick
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Made Blink aware of top controls offset Added all the plumbing to make Blink aware of the top controls position and how its viewport has been resized as a result. This CL adds all the machinery and plumbing but does not yet connect main-thread scrolls to the top controls. This is needed to support scrolling the top controls during slow-scrolls as well as correct viewport behavior in the virtual viewport pinch-to-zoom. The machinery for top controls now includes two values: top_controls_layout_height: The amount that the viewport was shrunk to accommodate the top controls. This is updated only during a layout that causes a viewport resize (i.e. RenderWidget::OnResize). The compositor needs this to know how much the viewport layer has already been resized by Blink. top_controls_content_offset: The amount that the top controls are showing. This will be the same as top_controls_layout_height right after a viewport resize, but will diverge since the top controls will move without immediately causing a RenderWidget resize. Blink now keeps track of the top controls "content offset", which is the distance the content is offset from the top of the screen due to top controls. It receives updates to this value from the Impl thread during a commit and echos them back to the compositor. On the compositor side, the top controls layout height is moved into the LayerTreeImpl. This is necessary since a commit will change the viewport layer's size on the pending tree. Keeping it in LayerTreeHostImpl meant that, until the pending tree was activated, the top controls layout height corresponded to the viewport bounds in the pending tree. This was causing flickering as the viewport container was the incorrect size for a short time. The compositor also keeps track of the top controls content offset value. The top controls offset uses the same model as page scale, keeping an offset (the value as known by the main thread), a delta from the main thread's value, and a sent_delta to keep track of what has been sent to the main thread. See https://codereview.chromium.org/513053003 for Blink-side patch. BUG=333143 Committed: https://crrev.com/88eae010cdf470913c2575222185c6ab99067df4 Cr-Commit-Position: refs/heads/master@{#294003}

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Total comments: 14

Patch Set 4 : First round of feedback from aelias #

Patch Set 5 : Added top_controls_content_offset #

Total comments: 4

Patch Set 6 : Added tests + Review Feedback #

Patch Set 7 : Rebase #

Patch Set 8 : Fixed crash + mojo example build break #

Unified diffs Side-by-side diffs Delta from patch set Stats (+471 lines, -201 lines) Patch
M android_webview/browser/hardware_renderer.h View 1 2 3 4 5 1 chunk +3 lines, -2 lines 0 comments Download
M cc/input/top_controls_manager.h View 1 2 3 4 3 chunks +6 lines, -5 lines 0 comments Download
M cc/input/top_controls_manager.cc View 1 2 3 4 10 chunks +26 lines, -19 lines 0 comments Download
M cc/input/top_controls_manager_client.h View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M cc/input/top_controls_manager_unittest.cc View 1 2 3 4 5 14 chunks +88 lines, -78 lines 0 comments Download
M cc/test/fake_layer_tree_host_client.h View 1 2 3 4 5 1 chunk +3 lines, -2 lines 0 comments Download
M cc/test/layer_tree_test.h View 1 2 3 4 5 1 chunk +3 lines, -2 lines 0 comments Download
M cc/test/layer_tree_test.cc View 1 2 3 4 5 6 1 chunk +6 lines, -3 lines 0 comments Download
M cc/trees/layer_tree_host.h View 1 2 3 4 2 chunks +3 lines, -1 line 0 comments Download
M cc/trees/layer_tree_host.cc View 1 2 3 4 5 6 5 chunks +31 lines, -8 lines 0 comments Download
M cc/trees/layer_tree_host_client.h View 1 2 3 4 5 1 chunk +3 lines, -2 lines 0 comments Download
M cc/trees/layer_tree_host_common.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M cc/trees/layer_tree_host_impl.h View 1 2 3 4 5 6 4 chunks +4 lines, -8 lines 0 comments Download
M cc/trees/layer_tree_host_impl.cc View 1 2 3 4 5 6 7 8 chunks +37 lines, -17 lines 0 comments Download
M cc/trees/layer_tree_host_impl_unittest.cc View 1 2 3 4 5 6 16 chunks +140 lines, -18 lines 0 comments Download
M cc/trees/layer_tree_host_unittest.cc View 1 2 3 4 5 1 chunk +3 lines, -2 lines 0 comments Download
M cc/trees/layer_tree_host_unittest_no_message_loop.cc View 1 2 3 4 5 6 1 chunk +3 lines, -2 lines 0 comments Download
M cc/trees/layer_tree_host_unittest_scroll.cc View 1 2 3 4 5 5 chunks +15 lines, -10 lines 0 comments Download
M cc/trees/layer_tree_impl.h View 1 2 3 4 5 6 2 chunks +40 lines, -0 lines 0 comments Download
M cc/trees/layer_tree_impl.cc View 1 2 3 4 5 6 3 chunks +16 lines, -1 line 0 comments Download
M content/browser/renderer_host/compositor_impl_android.h View 1 2 3 4 5 1 chunk +4 lines, -2 lines 0 comments Download
M content/renderer/gpu/render_widget_compositor.h View 1 2 3 4 5 6 2 chunks +5 lines, -3 lines 0 comments Download
M content/renderer/gpu/render_widget_compositor.cc View 1 2 3 4 5 6 3 chunks +13 lines, -6 lines 0 comments Download
M content/test/web_layer_tree_view_impl_for_testing.h View 1 2 3 4 5 1 chunk +3 lines, -2 lines 0 comments Download
M content/test/web_layer_tree_view_impl_for_testing.cc View 1 2 3 4 5 1 chunk +3 lines, -2 lines 0 comments Download
M mojo/examples/compositor_app/compositor_host.h View 1 2 3 4 5 6 7 1 chunk +3 lines, -2 lines 0 comments Download
M mojo/examples/compositor_app/compositor_host.cc View 1 2 3 4 5 6 7 1 chunk +3 lines, -2 lines 0 comments Download
M ui/compositor/compositor.h View 1 2 3 4 5 6 1 chunk +4 lines, -2 lines 0 comments Download

Messages

Total messages: 31 (5 generated)
bokan
bokan@chromium.org changed reviewers: + aelias@chromium.org
6 years, 3 months ago (2014-08-28 18:42:45 UTC) #1
bokan
Hi Alexandre, PTAL at this and the associated Blink patch. I've also renamed the top_controls_layout_height ...
6 years, 3 months ago (2014-08-28 18:42:45 UTC) #2
bokan
Forgot to mention, still working on tests so ignore the lack thereof.
6 years, 3 months ago (2014-08-28 21:34:28 UTC) #3
aelias_OOO_until_Jul13
https://codereview.chromium.org/511253003/diff/40001/cc/trees/layer_tree_host_client.h File cc/trees/layer_tree_host_client.h (right): https://codereview.chromium.org/511253003/diff/40001/cc/trees/layer_tree_host_client.h#newcode35 cc/trees/layer_tree_host_client.h:35: virtual void SetTopControlsContentOffset(int offset) = 0; I think if ...
6 years, 3 months ago (2014-08-29 04:37:02 UTC) #4
bokan
Sorry, I think I may have deceived you by making a confusing call. See inline ...
6 years, 3 months ago (2014-08-29 18:02:14 UTC) #5
aelias_OOO_until_Jul13
On 2014/08/29 18:02:14, bokan wrote: > Sorry, I think I may have deceived you by ...
6 years, 3 months ago (2014-08-29 20:37:15 UTC) #6
aelias_OOO_until_Jul13
Basically, the point of top_controls_layout_height is precisely to eliminate the confusion about by how much ...
6 years, 3 months ago (2014-08-29 21:00:37 UTC) #7
bokan
On 2014/08/29 21:00:37, aelias wrote: > Basically, the point of top_controls_layout_height is precisely to > ...
6 years, 3 months ago (2014-09-02 18:54:15 UTC) #8
bokan
https://codereview.chromium.org/511253003/diff/40001/cc/trees/layer_tree_host_common.h File cc/trees/layer_tree_host_common.h (right): https://codereview.chromium.org/511253003/diff/40001/cc/trees/layer_tree_host_common.h#newcode143 cc/trees/layer_tree_host_common.h:143: int top_controls_content_offset; On 2014/08/29 04:37:01, aelias wrote: > scrolls ...
6 years, 3 months ago (2014-09-02 18:57:16 UTC) #9
aelias_OOO_until_Jul13
On 2014/09/02 18:54:15, bokan wrote: > On 2014/08/29 21:00:37, aelias wrote: > > Basically, the ...
6 years, 3 months ago (2014-09-02 23:13:47 UTC) #10
bokan
On 2014/09/02 23:13:47, aelias wrote: > On 2014/09/02 18:54:15, bokan wrote: > > On 2014/08/29 ...
6 years, 3 months ago (2014-09-03 18:41:53 UTC) #11
aelias_OOO_until_Jul13
Looks good modulo nits, just needs tests. https://codereview.chromium.org/511253003/diff/80001/cc/input/top_controls_manager_client.h File cc/input/top_controls_manager_client.h (right): https://codereview.chromium.org/511253003/diff/80001/cc/input/top_controls_manager_client.h#newcode14 cc/input/top_controls_manager_client.h:14: virtual void ...
6 years, 3 months ago (2014-09-03 19:38:14 UTC) #12
aelias_OOO_until_Jul13
On 2014/09/03 at 18:41:53, bokan wrote: > This still has the problem of clamping. When ...
6 years, 3 months ago (2014-09-03 19:38:48 UTC) #13
bokan
PTAL, everything's cleaned up and tests added. https://codereview.chromium.org/511253003/diff/80001/cc/input/top_controls_manager_client.h File cc/input/top_controls_manager_client.h (right): https://codereview.chromium.org/511253003/diff/80001/cc/input/top_controls_manager_client.h#newcode14 cc/input/top_controls_manager_client.h:14: virtual void ...
6 years, 3 months ago (2014-09-04 23:09:52 UTC) #14
aelias_OOO_until_Jul13
cc/ lgtm
6 years, 3 months ago (2014-09-05 00:32:57 UTC) #15
bokan
+piman@ for content/ +mkosiba@ for android_webview/
6 years, 3 months ago (2014-09-05 01:09:01 UTC) #17
bokan
On 2014/09/05 01:09:01, bokan wrote: > +piman@ for content/ ...and ui/compositor/
6 years, 3 months ago (2014-09-05 01:09:44 UTC) #18
piman
lgtm
6 years, 3 months ago (2014-09-05 01:14:49 UTC) #19
mkosiba (inactive)
android_webview/ LGTM
6 years, 3 months ago (2014-09-05 09:58:42 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bokan@chromium.org/511253003/120001
6 years, 3 months ago (2014-09-09 02:55:21 UTC) #22
commit-bot: I haz the power
Try jobs failed on following builders: mac_gpu_retina_triggered_tests on tryserver.chromium.gpu (http://build.chromium.org/p/tryserver.chromium.gpu/builders/mac_gpu_retina_triggered_tests/builds/45227) mac_chromium_compile_dbg on tryserver.chromium.mac (http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_compile_dbg/builds/13523) win_chromium_x64_rel_swarming ...
6 years, 3 months ago (2014-09-09 08:21:48 UTC) #24
bokan
+jamesr@ for build fix in mojo example
6 years, 3 months ago (2014-09-09 12:41:30 UTC) #26
jamesr
mojo lgtm
6 years, 3 months ago (2014-09-09 18:30:04 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bokan@chromium.org/511253003/140001
6 years, 3 months ago (2014-09-09 18:39:25 UTC) #29
commit-bot: I haz the power
Committed patchset #8 (id:140001) as 72d0df85d72d51a904415537ce16e269006be193
6 years, 3 months ago (2014-09-09 20:45:39 UTC) #30
commit-bot: I haz the power
6 years, 3 months ago (2014-09-10 03:55:25 UTC) #31
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/88eae010cdf470913c2575222185c6ab99067df4
Cr-Commit-Position: refs/heads/master@{#294003}

Powered by Google App Engine
This is Rietveld 408576698