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

Issue 2295343005: Improve PictureLayerTiling::CoverageIterator to handle rounding more precisely (Closed)

Created:
4 years, 3 months ago by trchen
Modified:
4 years, 3 months ago
Reviewers:
danakj, enne (OOO)
CC:
cc-bugs_chromium.org, chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Improve PictureLayerTiling::CoverageIterator to handle rounding more precisely There are some rare corner cases that PictureLayerTiling::CoverageIterator could generate quads that slightly exceed valid sample extent due to rounding error. Due to bilinear filtering, the valid sample extent of a texture without introducing clamping error is the rect enclosed by texel sample points. For example, a texture of 256 x 256 without MSAA has top-left sample point at (0.5, 0.5) and bottom-right sample point at (255.5, 255.5). Therefore the sample extent of such texture is the rect (x=0.5, y=0.5, w=255, h=255). Previously the geometry rect of a tile is computed by: geometry_rect = ScaleToEnclosingRect(tile_bounds, content_to_dest) The tile_bounds is enclosed by the pixel border of the tile minus the extra border texels, which a conservative estimate of the sample extent (reserves a margin of 0.5 texels). However rounding out the rect in dest space can introduce rounding error up to 1.0 texels, which blew up the error budget. This CL changed the formula to: geometry_rect = ScaleToEnclosedRect(sample_extent, content_to_dest) Where the sample extent is an exact rect with no error margin. Then we round inward instead of outward for a conservative rect after scaling to dest space. Numerical analysis for coverage proof can be found at https://crbug.com/643464 BUG=643464 CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_precise_blink_rel Committed: https://crrev.com/d5e2d15230ddfe690803663e408389eeaf17afe6 Cr-Commit-Position: refs/heads/master@{#420170}

Patch Set 1 #

Total comments: 10

Patch Set 2 : simplify & add tests #

Total comments: 26

Patch Set 3 : address comments #

Patch Set 4 : address comments #

Total comments: 2

Patch Set 5 : remove the 1.5 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+201 lines, -57 lines) Patch
M cc/base/tiling_data.h View 2 chunks +3 lines, -0 lines 0 comments Download
M cc/base/tiling_data.cc View 2 chunks +7 lines, -0 lines 0 comments Download
M cc/layers/picture_layer_impl.cc View 1 2 1 chunk +4 lines, -2 lines 0 comments Download
M cc/layers/picture_layer_impl_unittest.cc View 1 2 3 4 chunks +19 lines, -9 lines 0 comments Download
M cc/tiles/picture_layer_tiling.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M cc/tiles/picture_layer_tiling.cc View 1 2 3 4 2 chunks +71 lines, -22 lines 0 comments Download
M cc/tiles/picture_layer_tiling_unittest.cc View 1 2 9 chunks +96 lines, -24 lines 0 comments Download

Messages

Total messages: 35 (16 generated)
trchen
PTAL. I'm not very familiar with unit test techniques in cc. Which test would you ...
4 years, 3 months ago (2016-09-02 01:26:00 UTC) #4
enne (OOO)
On 2016/09/02 at 01:26:00, trchen wrote: > PTAL. I'm not very familiar with unit test ...
4 years, 3 months ago (2016-09-02 19:04:54 UTC) #5
trchen
No new CL uploaded yet, just replying comments. Will ping again as soon as I ...
4 years, 3 months ago (2016-09-02 23:06:54 UTC) #6
chrishtr
On 2016/09/02 at 23:06:54, trchen wrote: > No new CL uploaded yet, just replying comments. ...
4 years, 3 months ago (2016-09-02 23:17:43 UTC) #7
trchen
On 2016/09/02 23:17:43, chrishtr wrote: > A code review style point: > > What does ...
4 years, 3 months ago (2016-09-02 23:30:10 UTC) #10
chrishtr
On 2016/09/02 at 23:30:10, trchen wrote: > On 2016/09/02 23:17:43, chrishtr wrote: > > A ...
4 years, 3 months ago (2016-09-03 01:25:06 UTC) #11
enne (OOO)
On 2016/09/02 at 23:06:54, trchen wrote: > https://codereview.chromium.org/2295343005/diff/1/cc/tiles/picture_layer_tiling.cc#newcode411 > cc/tiles/picture_layer_tiling.cc:411: // Shrink rect by 1/512 ...
4 years, 3 months ago (2016-09-06 18:28:21 UTC) #12
trchen
Patchset 2 uploaded! This version switched to a different numerical tolerance strategy, which simplified logic ...
4 years, 3 months ago (2016-09-07 05:44:15 UTC) #13
enne (OOO)
This is looking much better. Thanks for all the comments and the tests. I have ...
4 years, 3 months ago (2016-09-09 21:46:34 UTC) #18
trchen
https://codereview.chromium.org/2295343005/diff/20001/cc/layers/picture_layer_impl.cc File cc/layers/picture_layer_impl.cc (right): https://codereview.chromium.org/2295343005/diff/20001/cc/layers/picture_layer_impl.cc#newcode838 cc/layers/picture_layer_impl.cc:838: float dest_scale = MaximumTilingContentsScale(); On 2016/09/09 21:46:33, enne wrote: ...
4 years, 3 months ago (2016-09-09 23:39:19 UTC) #19
trchen
Ping?
4 years, 3 months ago (2016-09-15 08:32:53 UTC) #20
enne (OOO)
https://codereview.chromium.org/2295343005/diff/20001/cc/tiles/picture_layer_tiling.cc File cc/tiles/picture_layer_tiling.cc (right): https://codereview.chromium.org/2295343005/diff/20001/cc/tiles/picture_layer_tiling.cc#newcode405 cc/tiles/picture_layer_tiling.cc:405: // Clamp dest_rect_ to the bounds of the layer. ...
4 years, 3 months ago (2016-09-15 18:06:23 UTC) #21
trchen
On 2016/09/15 18:06:23, enne wrote: > https://codereview.chromium.org/2295343005/diff/20001/cc/tiles/picture_layer_tiling.cc > File cc/tiles/picture_layer_tiling.cc (right): > > https://codereview.chromium.org/2295343005/diff/20001/cc/tiles/picture_layer_tiling.cc#newcode405 > ...
4 years, 3 months ago (2016-09-16 02:24:51 UTC) #22
enne (OOO)
https://codereview.chromium.org/2295343005/diff/60001/cc/tiles/picture_layer_tiling.cc File cc/tiles/picture_layer_tiling.cc (right): https://codereview.chromium.org/2295343005/diff/60001/cc/tiles/picture_layer_tiling.cc#newcode501 cc/tiles/picture_layer_tiling.cc:501: (tile_i_ != data.num_tiles_x() - 1) ? -epsilon : -1.5, ...
4 years, 3 months ago (2016-09-16 17:50:49 UTC) #23
trchen
CL uploaded. (Removed the 1.5 hack.) https://codereview.chromium.org/2295343005/diff/60001/cc/tiles/picture_layer_tiling.cc File cc/tiles/picture_layer_tiling.cc (right): https://codereview.chromium.org/2295343005/diff/60001/cc/tiles/picture_layer_tiling.cc#newcode501 cc/tiles/picture_layer_tiling.cc:501: (tile_i_ != data.num_tiles_x() ...
4 years, 3 months ago (2016-09-21 03:39:27 UTC) #24
enne (OOO)
lgtm
4 years, 3 months ago (2016-09-21 17:12:35 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2295343005/80001
4 years, 3 months ago (2016-09-21 21:44:07 UTC) #31
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 3 months ago (2016-09-21 21:50:03 UTC) #33
commit-bot: I haz the power
4 years, 3 months ago (2016-09-21 21:52:50 UTC) #35
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/d5e2d15230ddfe690803663e408389eeaf17afe6
Cr-Commit-Position: refs/heads/master@{#420170}

Powered by Google App Engine
This is Rietveld 408576698