Closed Bug 1779512 Opened 2 years ago Closed 2 years ago

[wpt-sync] Sync PR 34839 - Fix hairlines along edges of mask bounding box in masked layers

Categories

(Core :: Web Painting, task, P4)

task

Tracking

()

RESOLVED FIXED
104 Branch
Tracking Status
firefox104 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 34839 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/34839
Details from upstream follow.

Xianzhu Wang <wangxianzhu@chromium.org> wrote:

Fix hairlines along edges of mask bounding box in masked layers

The following cased the hairlines:

  1. Both the mask layer and the masked layer were under the same clip
    node which clips the layers to the mask bounding box;
  2. The mask layer and the masked layer used different raster scales,
    and mapping clip rects between the layer space and the screen
    space caused errors. In the screen space, if the rect on the
    masked layer was bigger than the mask layer, pixels along the
    edges of the mask bounding box in the masked layer would
    be visible.

We can't force the same raster scale of the masked layer and the mask
layer because sometimes they are determined independently for the best
result of each layer. For example, we want to use the native scale for
surface layers (used for composited videos).

To solve the problem:

  1. Change the output clip of the mask effect node and its isolation
    group node from the mask clip to the parent of the mask clip.
  2. Change the painted result of the mask layer to the above output
    clip, so that the mask is no longer clipped by the mask bounding
    box.
  3. Expand the bounds of the mask layer to make sure it always covers
    the masked layer.

This won't change the rendered result (except for slight change in
anti-aliased pixels when the surface/texture pixels are not 1:1
matching physical pixels) because the mask layer should be transparent
outside of the mask bounding box, and these transparent pixels should
mask off the pixels in the masked layers just like an exact mask clip.

Bug: 1171601
Change-Id: I85ff66e54eb67d8be01a5791d38622397da3cdf7

Reviewed-on: https://chromium-review.googlesource.com/3742680
WPT-Export-Revision: bce5320aa61c5de8dc90defd93855edfadf335a4

Component: web-platform-tests → Web Painting
Product: Testing → Core
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]

CI Results

Ran 0 Firefox configurations based on mozilla-central, and Firefox, and Chrome on GitHub CI

Total 4 tests

Status Summary

Firefox

PASS: 4

Chrome

PASS: 3
FAIL: 1

Links

GitHub PR Head
GitHub PR Base

Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/54f5160c6a87
[wpt PR 34839] - Fix hairlines along edges of mask bounding box in masked layers, a=testonly
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 104 Branch
You need to log in before you can comment on or make changes to this bug.