Chromium Code Reviews
DescriptionAdjust the pixel snapping methodology for tiled backgrounds
The BackgroundImageGeometry::pixelSnapGeometry method was using rounding
for tile spacing and flooring for phase, resulting in one pixel gaps in
coverage on the top/left of a repeat: space tiled image. This results in
incompatible rounding for phase, space and tilesize, the combination of which
leads to sub-optimal tiling for background-repeat: space; content, including
missing coverage at the edge of a tiled area.
The new test explicitly shows this issue. Existing results for
svg/as-background-image/background-repeat.html,
ietestcenter/css3/bordersbackgrounds/background-repeat-space-padding-box.htm
and fast/images/color-profile-mask-image-svg.html are
noticeably better. Other results move the background by a pixel or less
with no negative impact on the quality of the result.
The test fast/backgrounds/background-position-zoomed.html was relying on
the floor behavior due to the test zooming odd numbers by 0.5. A minor test
change fixes the problem. Note that any test relying on pulling exact pixels
from the image will fail at some zoom level due to the fact we are rounding
to integers.
This patch also removes the redundant imageContainerSize member and accessor,
because it is always the same as the tile size.
R=trchen@chromium.org, leviw@chromium.org
BUG=593861
Committed: https://crrev.com/a75de675cbb8f9f594fabc68236a4547975ad7fe
Cr-Commit-Position: refs/heads/master@{#380972}
Patch Set 1 #Patch Set 2 : Snap as we go #
Total comments: 2
Patch Set 3 : Best solution so far #Patch Set 4 : Fix expectation #Patch Set 5 : Removed bad comment #Messages
Total messages: 36 (17 generated)
|