Open Bug 1840747 Opened 1 year ago Updated 6 months ago

WebRender's diagonal-edge antialiasing produces fringe from covered-up shape

Categories

(Core :: Graphics: WebRender, defect, P2)

defect

Tracking

()

People

(Reporter: dholbert, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(4 files)

I'm spinning this off from bug 1819467 for the underlying WebRender behavior discussed there (so I can use bug 1819467 to land some minor test tweaks).

Essentially: there are some WPTs that have a red shape covered up by a green shape, with the red shape being 1px smaller at all the vertices (so clearly "covered up").

Nonetheless, we draw a slight red fringe along the shape's diagonal edges.

This seems to be WebRender-specific, and it doesn't reproduce at certain zoom levels, nor does it reproduce if you use Firefox's "take screenshot" context-menu feature (I think because that uses a different graphical backend for the screenshot), per bug 1819467 comment 3.

STR:

  1. Load the attached testcase.
  2. Look very closely inside the black boxes (using default 100% zoom level)

ACTUAL RESULTS:
There are some faint red diagonal lines.

EXPECTED RESULTS:
No such lines.

Here's a screenshot showing the bug in current Nightly 116.0a1 (2023-06-26).

(screenshot taken with an OS screenshot tool, not Firefox screenshots, since Firefox screenshots avoids the bug as discussed above)

In case it's hard to see the streaks in the above screenshot, here's a zoomed in view of the bottom left corner to make it a bit easier, with an arrow drawn in pointing to the streak.

Essentially: there are some WPTs that have a red shape covered up by a green shape, with the red shape being 1px smaller at all the vertices (so clearly "covered up").

Here's a testcase to demonstrate this^, i.e. to show that the red shape is indeed smaller. I've moved the red shape to the foreground and changed the other shape (the one that would normally cover it) to lime so that you can see its bounds.

This lets you see that the red shape does indeed get a lime "border" on all sides, which indicates that the red shape is smaller than the shape that the test is expecting to cover it up.

(My theory here is that the red shape is 1px inwards from the lime shape in the x axis and y axis, but in the orthogonal-to-the-diagonal-direction, it's less than 1px away from redness -- and that's how we end up sampling a little bit of red when drawing that antialiased edge.)

Setting Severity to match parent report 1819467.

Severity: -- → S3
Priority: -- → P2

FWIW it seems this issue doesn't reproduce when we use drawSnapshot, i.e. in reftest runs with useDrawSnapshot (debug-reftest-snapshot test runs). I think that's the same backend we use as for Firefox's "take screenshot" context-menu option (which we already observed is unaffected by this bug as noted in comment 0).

Blocks: wr-investigate-glitch
No longer blocks: 1819467
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: