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

Issue 23533051: [android_webview] Use a fraction to calculate scroll offset. (Closed)

Created:
7 years, 3 months ago by mkosiba (inactive)
Modified:
7 years, 2 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, cc-bugs_chromium.org, jam, android-webview-reviews_chromium.org, wjmaclean, jdduke (slow), mnaganov (inactive)
Visibility:
Public.

Description

[android_webview] Use a fraction to calculate scroll offset. android_webview/ has to expose scroll offset operations in physical pixels while cc/ stores scroll offsets in dip pixels. Unfortunately the physical pixel values android_webview/ exposes are rounded so there is no such combination of rounding operations that allows for scrolls to 'bottom' in one corrdinate space to always be 'flush' against the bottom edge in the other. The most natural solution is to convert the scroll offset to the fraction of the scroll range. By using the max_scroll_offset value obtained directly from the compositor we're also removing the need to delay scrolls since the content size is always as recent as the scroll offset update. BUG=261239 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=225348

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : get rid of NaNs #

Total comments: 15

Patch Set 5 : #

Total comments: 12

Patch Set 6 : #

Patch Set 7 : don't call onScaleChanged from updateFrameInfo either #

Patch Set 8 : revert changes from previous patch set as they break AwSettings tests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+340 lines, -204 lines) Patch
M android_webview/browser/browser_view_renderer.h View 1 2 3 4 2 chunks +9 lines, -1 line 0 comments Download
M android_webview/browser/in_process_view_renderer.h View 1 2 3 4 4 chunks +9 lines, -2 lines 0 comments Download
M android_webview/browser/in_process_view_renderer.cc View 1 2 3 4 5 4 chunks +75 lines, -31 lines 0 comments Download
M android_webview/java/src/org/chromium/android_webview/AwContents.java View 1 2 3 4 5 7 7 chunks +25 lines, -22 lines 0 comments Download
M android_webview/java/src/org/chromium/android_webview/AwScrollOffsetManager.java View 1 2 10 chunks +19 lines, -46 lines 0 comments Download
M android_webview/javatests/src/org/chromium/android_webview/test/AndroidScrollIntegrationTest.java View 9 chunks +50 lines, -15 lines 0 comments Download
M android_webview/javatests/src/org/chromium/android_webview/test/AwScrollOffsetManagerTest.java View 1 2 12 chunks +11 lines, -59 lines 0 comments Download
M android_webview/native/aw_contents.h View 1 2 3 4 1 chunk +5 lines, -4 lines 0 comments Download
M android_webview/native/aw_contents.cc View 1 2 3 4 4 chunks +27 lines, -8 lines 0 comments Download
M cc/input/layer_scroll_offset_delegate.h View 1 2 3 4 3 chunks +15 lines, -1 line 0 comments Download
M cc/layers/layer_impl.cc View 1 2 3 4 2 chunks +6 lines, -1 line 0 comments Download
M cc/layers/layer_impl_unittest.cc View 1 2 3 4 5 3 chunks +7 lines, -0 lines 0 comments Download
M cc/trees/layer_tree_host_impl_unittest.cc View 1 2 3 4 5 4 chunks +42 lines, -1 line 0 comments Download
M cc/trees/layer_tree_impl.cc View 1 2 3 4 2 chunks +12 lines, -0 lines 0 comments Download
M content/browser/android/in_process/synchronous_compositor_impl.h View 1 2 3 4 1 chunk +3 lines, -0 lines 0 comments Download
M content/browser/android/in_process/synchronous_compositor_impl.cc View 1 2 3 4 5 2 chunks +19 lines, -0 lines 0 comments Download
M content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java View 1 2 3 4 7 4 chunks +1 line, -13 lines 0 comments Download
M content/public/browser/android/synchronous_compositor_client.h View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 15 (0 generated)
mkosiba (inactive)
PTAL https://codereview.chromium.org/23533051/diff/6001/android_webview/browser/in_process_view_renderer.cc File android_webview/browser/in_process_view_renderer.cc (right): https://codereview.chromium.org/23533051/diff/6001/android_webview/browser/in_process_view_renderer.cc#newcode733 android_webview/browser/in_process_view_renderer.cc:733: max_offset.y()); I could alternatively write these as gfx::Vector2dF ...
7 years, 2 months ago (2013-09-24 18:43:04 UTC) #1
aelias_OOO_until_Jul13
lgtm modulo comments below https://codereview.chromium.org/23533051/diff/6001/android_webview/browser/in_process_view_renderer.cc File android_webview/browser/in_process_view_renderer.cc (right): https://codereview.chromium.org/23533051/diff/6001/android_webview/browser/in_process_view_renderer.cc#newcode720 android_webview/browser/in_process_view_renderer.cc:720: return gfx::ToRoundedVector2d(gfx::ScaleVector2d( Is there a ...
7 years, 2 months ago (2013-09-24 22:03:19 UTC) #2
mkosiba (inactive)
Thanks Alex! Really good feedback. I'll update the CL tomorrow but I had just one ...
7 years, 2 months ago (2013-09-24 23:18:52 UTC) #3
aelias_OOO_until_Jul13
https://codereview.chromium.org/23533051/diff/6001/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java File content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java (right): https://codereview.chromium.org/23533051/diff/6001/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java#newcode2398 content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java:2398: mUpdateFrameInfoListener.onFrameInfoUpdated(pageScaleFactor); On 2013/09/24 23:18:53, mkosiba wrote: > Do you ...
7 years, 2 months ago (2013-09-24 23:24:26 UTC) #4
mkosiba (inactive)
On 2013/09/24 23:24:26, aelias wrote: > https://codereview.chromium.org/23533051/diff/6001/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java > File > content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java > (right): > > ...
7 years, 2 months ago (2013-09-24 23:57:57 UTC) #5
aelias_OOO_until_Jul13
The root layer size doesn't change between activations, no. Using ScrollableSize() should work (as long ...
7 years, 2 months ago (2013-09-25 00:06:08 UTC) #6
mkosiba (inactive)
https://codereview.chromium.org/23533051/diff/6001/android_webview/browser/in_process_view_renderer.cc File android_webview/browser/in_process_view_renderer.cc (right): https://codereview.chromium.org/23533051/diff/6001/android_webview/browser/in_process_view_renderer.cc#newcode736 android_webview/browser/in_process_view_renderer.cc:736: DCHECK(0 <= scroll_offset_dip.x()); On 2013/09/24 22:03:19, aelias wrote: > ...
7 years, 2 months ago (2013-09-25 14:23:48 UTC) #7
mkosiba (inactive)
+joth for android_webview and content/ OWNER +bulach for content/public/browser/android OWNER review
7 years, 2 months ago (2013-09-25 15:02:28 UTC) #8
joth
lgtm with a couple nits https://codereview.chromium.org/23533051/diff/18001/android_webview/browser/in_process_view_renderer.cc File android_webview/browser/in_process_view_renderer.cc (right): https://codereview.chromium.org/23533051/diff/18001/android_webview/browser/in_process_view_renderer.cc#newcode803 android_webview/browser/in_process_view_renderer.cc:803: CHECK(page_scale_factor_ > 0); DCHECk ...
7 years, 2 months ago (2013-09-25 15:12:06 UTC) #9
bulach
lgtm, just nits: https://codereview.chromium.org/23533051/diff/18001/android_webview/browser/in_process_view_renderer.cc File android_webview/browser/in_process_view_renderer.cc (right): https://codereview.chromium.org/23533051/diff/18001/android_webview/browser/in_process_view_renderer.cc#newcode714 android_webview/browser/in_process_view_renderer.cc:714: DCHECK(dip_scale_ > 0); nit: DCHECK_GT https://codereview.chromium.org/23533051/diff/18001/android_webview/browser/in_process_view_renderer.cc#newcode756 ...
7 years, 2 months ago (2013-09-25 15:26:04 UTC) #10
mkosiba (inactive)
thanks! https://codereview.chromium.org/23533051/diff/18001/android_webview/browser/in_process_view_renderer.cc File android_webview/browser/in_process_view_renderer.cc (right): https://codereview.chromium.org/23533051/diff/18001/android_webview/browser/in_process_view_renderer.cc#newcode714 android_webview/browser/in_process_view_renderer.cc:714: DCHECK(dip_scale_ > 0); On 2013/09/25 15:26:05, bulach wrote: ...
7 years, 2 months ago (2013-09-25 16:14:14 UTC) #11
mkosiba (inactive)
+mnaganov FYI for the onScaleChanged changes.
7 years, 2 months ago (2013-09-25 19:07:10 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mkosiba@chromium.org/23533051/32001
7 years, 2 months ago (2013-09-25 19:14:55 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mkosiba@chromium.org/23533051/40001
7 years, 2 months ago (2013-09-25 21:26:20 UTC) #14
commit-bot: I haz the power
7 years, 2 months ago (2013-09-26 05:41:36 UTC) #15
Message was sent while issue was closed.
Change committed as 225348

Powered by Google App Engine
This is Rietveld 408576698