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

Issue 150603004: Fixed rounding issue on scrollbar rasterization. (Closed)

Created:
6 years, 10 months ago by bokan
Modified:
6 years, 10 months ago
Reviewers:
danakj, wjmaclean
CC:
chromium-reviews, cc-bugs_chromium.org
Visibility:
Public.

Description

Fixed rounding issue on scrollbar rasterization. Changed the painting method to translate the canvas back to the origin before performing the scale to prevent losing pixels due to rounding. Also made the it take the layer-space rect as a parameter, instead of trying to reconstruct it from the (possibly-clamped) content-rect, and calculate the layer-space to content-space scaling factor directly from rects. BUG=336534 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=252254

Patch Set 1 #

Total comments: 2

Patch Set 2 : #

Patch Set 3 : Added test #

Total comments: 6

Patch Set 4 : #

Total comments: 1

Patch Set 5 : #

Total comments: 4

Patch Set 6 : #

Total comments: 8

Patch Set 7 : Fixed scale #

Patch Set 8 : Fixed Test #

Total comments: 10

Patch Set 9 : #

Total comments: 10

Patch Set 10 : #

Patch Set 11 : Style fix #

Total comments: 2

Patch Set 12 : Removed ClearRenderSurface() #

Patch Set 13 : Fixed break on Android tests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+149 lines, -17 lines) Patch
M cc/layers/painted_scrollbar_layer.h View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -1 line 0 comments Download
M cc/layers/painted_scrollbar_layer.cc View 1 2 3 4 5 6 7 8 5 chunks +29 lines, -15 lines 0 comments Download
M cc/layers/scrollbar_layer_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +106 lines, -0 lines 0 comments Download
M cc/test/fake_scrollbar.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M cc/test/fake_scrollbar.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +11 lines, -1 line 0 comments Download

Messages

Total messages: 40 (0 generated)
bokan
6 years, 10 months ago (2014-01-31 18:53:51 UTC) #1
danakj
https://codereview.chromium.org/150603004/diff/1/cc/layers/painted_scrollbar_layer.cc File cc/layers/painted_scrollbar_layer.cc (right): https://codereview.chromium.org/150603004/diff/1/cc/layers/painted_scrollbar_layer.cc#newcode250 cc/layers/painted_scrollbar_layer.cc:250: float adjustmentX = round(location_.x() * contents_scale_x()); Using location_ here ...
6 years, 10 months ago (2014-01-31 18:58:43 UTC) #2
bokan
https://codereview.chromium.org/150603004/diff/1/cc/layers/painted_scrollbar_layer.cc File cc/layers/painted_scrollbar_layer.cc (right): https://codereview.chromium.org/150603004/diff/1/cc/layers/painted_scrollbar_layer.cc#newcode250 cc/layers/painted_scrollbar_layer.cc:250: float adjustmentX = round(location_.x() * contents_scale_x()); On 2014/01/31 18:58:43, ...
6 years, 10 months ago (2014-01-31 19:00:40 UTC) #3
bokan
What's the best way to test this? Seems like we'd want some kind of pixel ...
6 years, 10 months ago (2014-02-05 23:25:53 UTC) #4
wjmaclean
On 2014/02/05 23:25:53, bokan wrote: > What's the best way to test this? Seems like ...
6 years, 10 months ago (2014-02-06 00:11:48 UTC) #5
bokan
On 2014/02/06 00:11:48, wjmaclean wrote: > On 2014/02/05 23:25:53, bokan wrote: > > What's the ...
6 years, 10 months ago (2014-02-07 14:37:43 UTC) #6
wjmaclean
On 2014/02/07 14:37:43, bokan wrote: > On 2014/02/06 00:11:48, wjmaclean wrote: > > On 2014/02/05 ...
6 years, 10 months ago (2014-02-07 15:46:39 UTC) #7
bokan
On 2014/02/07 15:46:39, wjmaclean wrote: > On 2014/02/07 14:37:43, bokan wrote: > > On 2014/02/06 ...
6 years, 10 months ago (2014-02-07 16:02:16 UTC) #8
bokan
Ok, figured out a good way to test it (gMock is magical). PTAL
6 years, 10 months ago (2014-02-07 23:21:16 UTC) #9
wjmaclean
On 2014/02/07 23:21:16, bokan wrote: > Ok, figured out a good way to test it ...
6 years, 10 months ago (2014-02-10 14:46:26 UTC) #10
bokan
Dana, PTAL when you get a chance (at this one and https://codereview.chromium.org/140413007/)
6 years, 10 months ago (2014-02-10 18:45:27 UTC) #11
danakj
https://codereview.chromium.org/150603004/diff/150001/cc/layers/painted_scrollbar_layer.cc File cc/layers/painted_scrollbar_layer.cc (right): https://codereview.chromium.org/150603004/diff/150001/cc/layers/painted_scrollbar_layer.cc#newcode172 cc/layers/painted_scrollbar_layer.cc:172: gfx::Rect expanded_rect = gfx::ScaleToEnclosedRect( I don't believe this is ...
6 years, 10 months ago (2014-02-10 19:17:27 UTC) #12
danakj
https://codereview.chromium.org/150603004/diff/150001/cc/layers/painted_scrollbar_layer.cc File cc/layers/painted_scrollbar_layer.cc (right): https://codereview.chromium.org/150603004/diff/150001/cc/layers/painted_scrollbar_layer.cc#newcode253 cc/layers/painted_scrollbar_layer.cc:253: gfx::Rect layer_rect = gfx::ScaleToEnclosingRect( On 2014/02/10 19:17:28, danakj wrote: ...
6 years, 10 months ago (2014-02-10 19:19:31 UTC) #13
bokan
I've changed the rasterization method to additionally take the layer_rect, avoiding the truncation issues all ...
6 years, 10 months ago (2014-02-11 00:01:52 UTC) #14
bokan
Updated with previous feedback. The test ensures the SkCanvas's transformation matrix uses the rounded translation ...
6 years, 10 months ago (2014-02-12 18:32:45 UTC) #15
wjmaclean
still lgtm, see nits below. https://codereview.chromium.org/150603004/diff/320001/cc/layers/scrollbar_layer_unittest.cc File cc/layers/scrollbar_layer_unittest.cc (right): https://codereview.chromium.org/150603004/diff/320001/cc/layers/scrollbar_layer_unittest.cc#newcode776 cc/layers/scrollbar_layer_unittest.cc:776: Delete extra line space? ...
6 years, 10 months ago (2014-02-12 18:38:52 UTC) #16
bokan
Dana, PTAL. https://codereview.chromium.org/150603004/diff/320001/cc/layers/scrollbar_layer_unittest.cc File cc/layers/scrollbar_layer_unittest.cc (right): https://codereview.chromium.org/150603004/diff/320001/cc/layers/scrollbar_layer_unittest.cc#newcode776 cc/layers/scrollbar_layer_unittest.cc:776: On 2014/02/12 18:38:53, wjmaclean wrote: > Delete ...
6 years, 10 months ago (2014-02-13 19:04:57 UTC) #17
danakj
https://codereview.chromium.org/150603004/diff/420001/cc/layers/painted_scrollbar_layer.cc File cc/layers/painted_scrollbar_layer.cc (right): https://codereview.chromium.org/150603004/diff/420001/cc/layers/painted_scrollbar_layer.cc#newcode256 cc/layers/painted_scrollbar_layer.cc:256: // rounded origin coordinates Can you explain this logic? ...
6 years, 10 months ago (2014-02-13 19:16:22 UTC) #18
bokan
https://codereview.chromium.org/150603004/diff/420001/cc/layers/painted_scrollbar_layer.cc File cc/layers/painted_scrollbar_layer.cc (right): https://codereview.chromium.org/150603004/diff/420001/cc/layers/painted_scrollbar_layer.cc#newcode256 cc/layers/painted_scrollbar_layer.cc:256: // rounded origin coordinates On 2014/02/13 19:16:22, danakj wrote: ...
6 years, 10 months ago (2014-02-14 20:18:26 UTC) #19
danakj
Thanks! Some naming suggestions, and some more questions https://codereview.chromium.org/150603004/diff/620001/cc/layers/painted_scrollbar_layer.cc File cc/layers/painted_scrollbar_layer.cc (right): https://codereview.chromium.org/150603004/diff/620001/cc/layers/painted_scrollbar_layer.cc#newcode242 cc/layers/painted_scrollbar_layer.cc:242: float ...
6 years, 10 months ago (2014-02-14 20:38:30 UTC) #20
bokan
Sorry about the review churn. I took a step back and realized I was over ...
6 years, 10 months ago (2014-02-17 17:11:49 UTC) #21
danakj
Ok thanks! this is much nicer. one more round of questions about the test code ...
6 years, 10 months ago (2014-02-18 20:43:30 UTC) #22
bokan
https://codereview.chromium.org/150603004/diff/720001/cc/layers/scrollbar_layer_unittest.cc File cc/layers/scrollbar_layer_unittest.cc (right): https://codereview.chromium.org/150603004/diff/720001/cc/layers/scrollbar_layer_unittest.cc#newcode787 cc/layers/scrollbar_layer_unittest.cc:787: FakePaintedScrollbarLayer::Create(true, false, layer_tree_root->id()); On 2014/02/18 20:43:30, danakj wrote: > ...
6 years, 10 months ago (2014-02-18 21:48:15 UTC) #23
danakj
Thanks, LGTM https://codereview.chromium.org/150603004/diff/850001/cc/layers/scrollbar_layer_unittest.cc File cc/layers/scrollbar_layer_unittest.cc (right): https://codereview.chromium.org/150603004/diff/850001/cc/layers/scrollbar_layer_unittest.cc#newcode847 cc/layers/scrollbar_layer_unittest.cc:847: scrollbar_layer->ClearRenderSurface(); Why is this needed? I dont ...
6 years, 10 months ago (2014-02-18 21:55:55 UTC) #24
bokan
https://codereview.chromium.org/150603004/diff/850001/cc/layers/scrollbar_layer_unittest.cc File cc/layers/scrollbar_layer_unittest.cc (right): https://codereview.chromium.org/150603004/diff/850001/cc/layers/scrollbar_layer_unittest.cc#newcode847 cc/layers/scrollbar_layer_unittest.cc:847: scrollbar_layer->ClearRenderSurface(); On 2014/02/18 21:55:55, danakj wrote: > Why is ...
6 years, 10 months ago (2014-02-18 22:02:48 UTC) #25
bokan
The CQ bit was checked by bokan@chromium.org
6 years, 10 months ago (2014-02-18 22:03:01 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bokan@chromium.org/150603004/900001
6 years, 10 months ago (2014-02-18 22:03:12 UTC) #27
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-19 09:03:57 UTC) #28
commit-bot: I haz the power
The commit queue went berserk retrying too often for a seemingly flaky test on builder ...
6 years, 10 months ago (2014-02-19 09:03:57 UTC) #29
bokan
The CQ bit was checked by bokan@chromium.org
6 years, 10 months ago (2014-02-19 14:53:03 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bokan@chromium.org/150603004/900001
6 years, 10 months ago (2014-02-19 15:08:17 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bokan@chromium.org/150603004/900001
6 years, 10 months ago (2014-02-19 15:35:55 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bokan@chromium.org/150603004/900001
6 years, 10 months ago (2014-02-19 23:59:49 UTC) #33
bokan
The CQ bit was unchecked by bokan@chromium.org
6 years, 10 months ago (2014-02-20 00:01:17 UTC) #34
bokan
The CQ bit was checked by bokan@chromium.org
6 years, 10 months ago (2014-02-20 00:58:41 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bokan@chromium.org/150603004/1130004
6 years, 10 months ago (2014-02-20 01:41:55 UTC) #36
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bokan@chromium.org/150603004/1130004
6 years, 10 months ago (2014-02-20 05:11:57 UTC) #37
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bokan@chromium.org/150603004/1130004
6 years, 10 months ago (2014-02-20 09:07:47 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bokan@chromium.org/150603004/1130004
6 years, 10 months ago (2014-02-20 12:29:18 UTC) #39
commit-bot: I haz the power
6 years, 10 months ago (2014-02-20 16:04:22 UTC) #40
Message was sent while issue was closed.
Change committed as 252254

Powered by Google App Engine
This is Rietveld 408576698