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

Issue 584503005: Make scroll offset type of float in cc (Closed)

Created:
6 years, 3 months ago by Yufeng Shen (Slow to review)
Modified:
6 years, 2 months ago
Reviewers:
danakj, jdduke (slow)
CC:
chromium-reviews, cc-bugs_chromium.org, Rick Byers, mkosiba (inactive)
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Use ScrollOffset instead of vector2d to track scroll offset in cc This is for preparing converting blink side scroll offset to be double type. Assuming blink side starts to use double scroll offset, it can be passed back from main/blink to compositor without converting to int type. BUG=414283 Committed: https://crrev.com/f57925d399f2eda19fdaab9191257e51a3af04a0 Cr-Commit-Position: refs/heads/master@{#297692}

Patch Set 1 #

Patch Set 2 : update unittests #

Total comments: 16

Patch Set 3 : address comments #

Patch Set 4 : replace EXPECT_VECTOR_EQ with EXPECT_EQ #

Patch Set 5 : Use ScrollOffset instead of vector2dF for scroll offset #

Total comments: 26

Patch Set 6 : scroll delta -> vector2dF, scroll offset -> ScrollOffset #

Total comments: 46

Patch Set 7 : blow up the patchset :( #

Total comments: 22

Patch Set 8 : address comments #

Patch Set 9 : rebase #

Total comments: 2

Patch Set 10 : fix tests #

Total comments: 2

Patch Set 11 : link crbug to TODO #

Unified diffs Side-by-side diffs Delta from patch set Stats (+723 lines, -371 lines) Patch
M cc/animation/layer_animation_controller.h View 1 2 3 4 5 6 2 chunks +5 lines, -3 lines 0 comments Download
M cc/animation/layer_animation_controller.cc View 1 2 3 4 5 6 3 chunks +3 lines, -3 lines 0 comments Download
M cc/animation/layer_animation_controller_unittest.cc View 1 2 3 4 5 6 7 8 3 chunks +6 lines, -6 lines 0 comments Download
M cc/animation/layer_animation_value_observer.h View 1 2 3 4 5 6 7 3 chunks +4 lines, -2 lines 0 comments Download
M cc/animation/layer_animation_value_provider.h View 1 2 3 4 5 6 7 2 chunks +3 lines, -2 lines 0 comments Download
M cc/animation/scroll_offset_animation_curve.h View 1 2 3 4 5 6 3 chunks +9 lines, -8 lines 0 comments Download
M cc/animation/scroll_offset_animation_curve.cc View 1 2 3 4 5 6 7 8 4 chunks +15 lines, -13 lines 0 comments Download
M cc/animation/scroll_offset_animation_curve_unittest.cc View 1 2 3 4 5 6 6 chunks +22 lines, -21 lines 0 comments Download
M cc/base/math_util.h View 1 2 3 4 2 chunks +3 lines, -0 lines 0 comments Download
M cc/base/math_util.cc View 1 2 3 4 5 6 7 8 1 chunk +6 lines, -0 lines 0 comments Download
M cc/blink/web_layer_impl.cc View 1 2 3 4 5 6 2 chunks +4 lines, -2 lines 0 comments Download
M cc/blink/web_scroll_offset_animation_curve_impl.cc View 1 2 3 4 5 6 2 chunks +3 lines, -3 lines 0 comments Download
M cc/input/layer_scroll_offset_delegate.h View 1 2 3 4 5 3 chunks +9 lines, -8 lines 0 comments Download
M cc/layers/layer.h View 1 2 3 4 5 6 5 chunks +10 lines, -10 lines 0 comments Download
M cc/layers/layer.cc View 1 2 3 4 5 6 7 8 5 chunks +8 lines, -6 lines 0 comments Download
M cc/layers/layer_impl.h View 1 2 3 4 5 6 6 chunks +15 lines, -14 lines 0 comments Download
M cc/layers/layer_impl.cc View 1 2 3 4 5 6 7 8 16 chunks +38 lines, -35 lines 0 comments Download
M cc/layers/layer_impl_unittest.cc View 1 2 3 4 5 6 7 8 12 chunks +39 lines, -27 lines 0 comments Download
M cc/layers/layer_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M cc/layers/picture_layer_impl_perftest.cc View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -2 lines 0 comments Download
M cc/layers/scrollbar_layer_unittest.cc View 1 2 3 4 5 6 7 8 6 chunks +7 lines, -7 lines 0 comments Download
M cc/test/animation_test_common.h View 1 2 3 4 5 6 3 chunks +6 lines, -6 lines 0 comments Download
M cc/test/animation_test_common.cc View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -2 lines 0 comments Download
M cc/trees/layer_tree_host.cc View 1 2 3 4 5 6 7 8 2 chunks +9 lines, -6 lines 0 comments Download
M cc/trees/layer_tree_host_common.h View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 0 comments Download
M cc/trees/layer_tree_host_common.cc View 1 2 3 4 5 6 2 chunks +6 lines, -5 lines 0 comments Download
M cc/trees/layer_tree_host_common_unittest.cc View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -2 lines 0 comments Download
M cc/trees/layer_tree_host_impl.cc View 1 2 3 4 5 6 7 8 8 chunks +19 lines, -14 lines 0 comments Download
M cc/trees/layer_tree_host_impl_unittest.cc View 1 2 3 4 5 6 7 8 9 38 chunks +62 lines, -59 lines 0 comments Download
M cc/trees/layer_tree_host_perftest.cc View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M cc/trees/layer_tree_host_unittest.cc View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -3 lines 0 comments Download
M cc/trees/layer_tree_host_unittest_animation.cc View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -2 lines 0 comments Download
M cc/trees/layer_tree_host_unittest_damage.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M cc/trees/layer_tree_host_unittest_scroll.cc View 1 2 3 4 5 6 7 8 20 chunks +75 lines, -52 lines 0 comments Download
M cc/trees/layer_tree_impl.h View 1 2 3 4 5 2 chunks +3 lines, -3 lines 0 comments Download
M cc/trees/layer_tree_impl.cc View 1 2 3 4 5 6 7 8 8 chunks +16 lines, -15 lines 0 comments Download
M content/browser/android/in_process/synchronous_compositor_impl.h View 1 2 3 4 5 1 chunk +8 lines, -7 lines 0 comments Download
M content/browser/android/in_process/synchronous_compositor_impl.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +18 lines, -12 lines 0 comments Download
M ui/gfx/BUILD.gn View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M ui/gfx/geometry/BUILD.gn View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M ui/gfx/geometry/safe_integer_conversions.h View 1 2 3 4 1 chunk +8 lines, -0 lines 0 comments Download
M ui/gfx/geometry/safe_integer_conversions_unittest.cc View 1 2 3 4 5 6 2 chunks +2 lines, -2 lines 0 comments Download
A ui/gfx/geometry/scroll_offset.h View 1 2 3 4 5 6 7 1 chunk +125 lines, -0 lines 0 comments Download
A + ui/gfx/geometry/scroll_offset.cc View 1 2 3 4 5 6 7 1 chunk +4 lines, -6 lines 0 comments Download
A ui/gfx/geometry/scroll_offset_unittest.cc View 1 2 3 4 5 6 1 chunk +122 lines, -0 lines 0 comments Download
M ui/gfx/gfx.gyp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M ui/gfx/gfx_tests.gyp View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M ui/gfx/test/gfx_util.cc View 1 2 3 4 5 6 2 chunks +5 lines, -0 lines 0 comments Download

Messages

Total messages: 27 (3 generated)
Yufeng Shen (Slow to review)
6 years, 3 months ago (2014-09-18 20:38:24 UTC) #2
danakj
Left a comment on the bug about using floats for this, I'd like to discuss ...
6 years, 3 months ago (2014-09-18 21:21:52 UTC) #3
danakj
https://codereview.chromium.org/584503005/diff/20001/cc/trees/layer_tree_host_impl_unittest.cc File cc/trees/layer_tree_host_impl_unittest.cc (right): https://codereview.chromium.org/584503005/diff/20001/cc/trees/layer_tree_host_impl_unittest.cc#newcode213 cc/trees/layer_tree_host_impl_unittest.cc:213: EXPECT_TRUE(std::abs(diff_x) < 0.1e-10); You can use EXPECT_FLOAT_EQ for this ...
6 years, 3 months ago (2014-09-18 21:23:49 UTC) #4
Yufeng Shen (Slow to review)
https://codereview.chromium.org/584503005/diff/20001/cc/blink/web_layer_impl.h File cc/blink/web_layer_impl.h (right): https://codereview.chromium.org/584503005/diff/20001/cc/blink/web_layer_impl.h#newcode105 cc/blink/web_layer_impl.h:105: // TODO(miletus@): Remove the WebPoint version once blink side ...
6 years, 3 months ago (2014-09-18 22:47:56 UTC) #5
Yufeng Shen (Slow to review)
Updated to use ScrollOffset (internally using double) to track the scroll offset in cc. Adding/fixing ...
6 years, 3 months ago (2014-09-23 21:38:04 UTC) #6
danakj
https://codereview.chromium.org/584503005/diff/80001/cc/blink/web_layer_impl.cc File cc/blink/web_layer_impl.cc (right): https://codereview.chromium.org/584503005/diff/80001/cc/blink/web_layer_impl.cc#newcode272 cc/blink/web_layer_impl.cc:272: const std::pair<double, double>& position) { are you allowed to ...
6 years, 2 months ago (2014-09-25 15:13:31 UTC) #7
Yufeng Shen (Slow to review)
Thanks for the review. PTAL https://codereview.chromium.org/584503005/diff/80001/cc/blink/web_layer_impl.cc File cc/blink/web_layer_impl.cc (right): https://codereview.chromium.org/584503005/diff/80001/cc/blink/web_layer_impl.cc#newcode272 cc/blink/web_layer_impl.cc:272: const std::pair<double, double>& position) ...
6 years, 2 months ago (2014-09-25 20:06:24 UTC) #8
danakj
Thanks, I think this looks really nice overall https://codereview.chromium.org/584503005/diff/100001/cc/animation/layer_animation_controller.cc File cc/animation/layer_animation_controller.cc (right): https://codereview.chromium.org/584503005/diff/100001/cc/animation/layer_animation_controller.cc#newcode547 cc/animation/layer_animation_controller.cc:547: current_scroll_offset.ToVector2dF()); ...
6 years, 2 months ago (2014-09-25 22:01:27 UTC) #9
Yufeng Shen (Slow to review)
https://codereview.chromium.org/584503005/diff/100001/cc/trees/layer_tree_host.cc File cc/trees/layer_tree_host.cc (right): https://codereview.chromium.org/584503005/diff/100001/cc/trees/layer_tree_host.cc#newcode1107 cc/trees/layer_tree_host.cc:1107: gfx::ScrollOffset(outer_viewport_scroll_delta)); On 2014/09/25 22:01:26, danakj wrote: > Throwing this ...
6 years, 2 months ago (2014-09-25 22:15:01 UTC) #10
danakj
On Thu, Sep 25, 2014 at 6:15 PM, <miletus@chromium.org> wrote: > > https://codereview.chromium.org/584503005/diff/100001/cc/ > trees/layer_tree_host.cc ...
6 years, 2 months ago (2014-09-25 22:30:52 UTC) #11
chromium-reviews
On Thu, Sep 25, 2014 at 6:30 PM, Dana Jansens <danakj@chromium.org> wrote: > On Thu, ...
6 years, 2 months ago (2014-09-25 22:32:31 UTC) #12
danakj
On Thu, Sep 25, 2014 at 6:32 PM, Yufeng Shen <miletus@google.com> wrote: > > > ...
6 years, 2 months ago (2014-09-25 22:34:54 UTC) #13
Yufeng Shen (Slow to review)
The change is really contagious. Lets defer to TODO for any further non-essential change. PTAL, ...
6 years, 2 months ago (2014-09-26 20:19:08 UTC) #14
danakj
Thanks! This looks really nice. I have one more suggestion. I see a lot of ...
6 years, 2 months ago (2014-09-27 00:00:44 UTC) #15
Yufeng Shen (Slow to review)
" I see a lot of delta = gfx::ScrollOffsetToVector2dF(offset2 - offset1); How about instead we ...
6 years, 2 months ago (2014-09-29 19:27:34 UTC) #16
danakj
LGTM thanks I think this is very clean https://codereview.chromium.org/584503005/diff/160001/cc/trees/layer_tree_host_impl_unittest.cc File cc/trees/layer_tree_host_impl_unittest.cc (right): https://codereview.chromium.org/584503005/diff/160001/cc/trees/layer_tree_host_impl_unittest.cc#newcode3362 cc/trees/layer_tree_host_impl_unittest.cc:3362: gfx::ScrollOffset ...
6 years, 2 months ago (2014-10-01 03:08:08 UTC) #17
Yufeng Shen (Slow to review)
https://codereview.chromium.org/584503005/diff/160001/cc/trees/layer_tree_host_impl_unittest.cc File cc/trees/layer_tree_host_impl_unittest.cc (right): https://codereview.chromium.org/584503005/diff/160001/cc/trees/layer_tree_host_impl_unittest.cc#newcode3362 cc/trees/layer_tree_host_impl_unittest.cc:3362: gfx::ScrollOffset scroll_delta(10.f, 10.f); On 2014/10/01 03:08:07, danakj wrote: > ...
6 years, 2 months ago (2014-10-01 16:30:15 UTC) #18
Yufeng Shen (Slow to review)
+ Jared for OWNER of content/browser/android/in_process/*
6 years, 2 months ago (2014-10-01 16:32:32 UTC) #20
jdduke (slow)
https://codereview.chromium.org/584503005/diff/180001/content/browser/android/in_process/synchronous_compositor_impl.cc File content/browser/android/in_process/synchronous_compositor_impl.cc (right): https://codereview.chromium.org/584503005/diff/180001/content/browser/android/in_process/synchronous_compositor_impl.cc#newcode262 content/browser/android/in_process/synchronous_compositor_impl.cc:262: // TODO(miletus): Make GetTotalRootLayerScrollOffset return Is there a bug ...
6 years, 2 months ago (2014-10-01 16:48:46 UTC) #21
Yufeng Shen (Slow to review)
https://codereview.chromium.org/584503005/diff/180001/content/browser/android/in_process/synchronous_compositor_impl.cc File content/browser/android/in_process/synchronous_compositor_impl.cc (right): https://codereview.chromium.org/584503005/diff/180001/content/browser/android/in_process/synchronous_compositor_impl.cc#newcode262 content/browser/android/in_process/synchronous_compositor_impl.cc:262: // TODO(miletus): Make GetTotalRootLayerScrollOffset return On 2014/10/01 16:48:46, jdduke ...
6 years, 2 months ago (2014-10-01 16:54:37 UTC) #22
jdduke (slow)
content/browser/android/in_process lgtm.
6 years, 2 months ago (2014-10-01 17:04:25 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/584503005/200001
6 years, 2 months ago (2014-10-01 17:18:46 UTC) #25
commit-bot: I haz the power
Committed patchset #11 (id:200001) as 381e7546497794f6ee980963910e1fdbed4d73c6
6 years, 2 months ago (2014-10-01 19:38:43 UTC) #26
commit-bot: I haz the power
6 years, 2 months ago (2014-10-01 19:39:17 UTC) #27
Message was sent while issue was closed.
Patchset 11 (id:??) landed as
https://crrev.com/f57925d399f2eda19fdaab9191257e51a3af04a0
Cr-Commit-Position: refs/heads/master@{#297692}

Powered by Google App Engine
This is Rietveld 408576698