New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 686435 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
Email to this user bounced
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Tiled background image and subpixel padding

Reported by ka...@opera.com, Jan 28 2017

Issue description

Background-image doesn't handle sub-pixel padding correctly.
When background-origin is set to content-box, a sub-pixel
padding will cause the calculated tile size to be one pixel
too small, in turn causing unnecessary tiling.

By default, background-origin is set to border-box, and since borders
currently aren't sub-pixel, the issue is rarely seen.

 

Comment 1 by ka...@opera.com, Jan 28 2017

subpixelpadding.html
263 bytes View Download
Status: Assigned (was: Untriaged)
karlo@, do you intend to try to fix this? If not, please add yourself to CC, remove from owner and change status to Available.

The fix requires significant changes to how images are processed throughout the Blink to Compositor pipeline. The immediate cause is the lack of LayoutUnit methods for specifying tiling parameters, due to Skia's preference for on-pixel-boundary images and tiling. I have an open issue to improve this and any fix to this bug would probably be a lot simpler once that is done.

Comment 3 by ka...@opera.com, Feb 6 2017

Sorry for not responding sooner; BlinkOn and jet lag happened in the meanwhile.

I think I have a fix for this particular issue, the code simply fails to account for borders and padding when calculating tile sizes.  As long as borders and padding are integer sizes (which they usually are), this doesn't matter, but if they are not, the tile size calculation runs into problems.

I'll submit a review shortly.

Comment 4 by ka...@opera.com, Feb 10 2017

Summary: Tiled background image and subpixel padding (was: Tiled background image)
Project Member

Comment 6 by bugdroid1@chromium.org, Mar 6 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f5667c6812249214f1c8ee322b21c6f337b766cc

commit f5667c6812249214f1c8ee322b21c6f337b766cc
Author: karlo <karlo@opera.com>
Date: Mon Mar 06 10:36:32 2017

Calculate positioningArea and not just size, for tiling background.

Computing the correct background tiling size when sub-pixel border or
padding is used, requires calculating the full positioning area and not
just size. The actual fix for 686435 is in a followup cl.

BUG= 686435 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2690053002
Cr-Commit-Position: refs/heads/master@{#454843}

[modify] https://crrev.com/f5667c6812249214f1c8ee322b21c6f337b766cc/third_party/WebKit/Source/core/paint/BackgroundImageGeometry.cpp

Project Member

Comment 7 by bugdroid1@chromium.org, Mar 8 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0957d8cc17fb3e90d3f0203a0e3cc1b32bfc8528

commit 0957d8cc17fb3e90d3f0203a0e3cc1b32bfc8528
Author: karlo <karlo@opera.com>
Date: Wed Mar 08 15:13:28 2017

Account for borders and padding when calculating background tile size.

This is required when sub-pixel borders and padding are used, otherwise
the tile size may become one pixel too small, causing rendering artifacts.
Test case attached.

BUG= 686435 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2689993003
Cr-Commit-Position: refs/heads/master@{#455454}

[add] https://crrev.com/0957d8cc17fb3e90d3f0203a0e3cc1b32bfc8528/third_party/WebKit/LayoutTests/fast/backgrounds/background-tiling-sub-pixel-expected.html
[add] https://crrev.com/0957d8cc17fb3e90d3f0203a0e3cc1b32bfc8528/third_party/WebKit/LayoutTests/fast/backgrounds/background-tiling-sub-pixel.html
[modify] https://crrev.com/0957d8cc17fb3e90d3f0203a0e3cc1b32bfc8528/third_party/WebKit/LayoutTests/platform/linux/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png
[modify] https://crrev.com/0957d8cc17fb3e90d3f0203a0e3cc1b32bfc8528/third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png
[add] https://crrev.com/0957d8cc17fb3e90d3f0203a0e3cc1b32bfc8528/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png
[add] https://crrev.com/0957d8cc17fb3e90d3f0203a0e3cc1b32bfc8528/third_party/WebKit/LayoutTests/platform/mac-mac10.11/svg/zoom/page/zoom-background-images-expected.png
[modify] https://crrev.com/0957d8cc17fb3e90d3f0203a0e3cc1b32bfc8528/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png
[add] https://crrev.com/0957d8cc17fb3e90d3f0203a0e3cc1b32bfc8528/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png
[add] https://crrev.com/0957d8cc17fb3e90d3f0203a0e3cc1b32bfc8528/third_party/WebKit/LayoutTests/platform/mac-retina/svg/zoom/page/zoom-background-images-expected.png
[modify] https://crrev.com/0957d8cc17fb3e90d3f0203a0e3cc1b32bfc8528/third_party/WebKit/LayoutTests/platform/mac/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png
[modify] https://crrev.com/0957d8cc17fb3e90d3f0203a0e3cc1b32bfc8528/third_party/WebKit/LayoutTests/platform/mac/svg/zoom/page/zoom-background-images-expected.png
[modify] https://crrev.com/0957d8cc17fb3e90d3f0203a0e3cc1b32bfc8528/third_party/WebKit/LayoutTests/platform/win/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png
[modify] https://crrev.com/0957d8cc17fb3e90d3f0203a0e3cc1b32bfc8528/third_party/WebKit/LayoutTests/platform/win/svg/zoom/page/zoom-background-images-expected.png
[modify] https://crrev.com/0957d8cc17fb3e90d3f0203a0e3cc1b32bfc8528/third_party/WebKit/LayoutTests/platform/win7/fast/forms/calendar-picker/calendar-picker-appearance-zoom125-expected.png
[modify] https://crrev.com/0957d8cc17fb3e90d3f0203a0e3cc1b32bfc8528/third_party/WebKit/Source/core/paint/BackgroundImageGeometry.cpp

Comment 8 by ka...@opera.com, Mar 9 2017

Status: Fixed (was: Assigned)

Sign in to add a comment