Closed Bug 2015400 Opened 7 months ago Closed 7 months ago

Fix the antialiasing of quad primitives

Categories

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

defect

Tracking

()

RESOLVED FIXED
149 Branch
Tracking Status
firefox149 --- fixed

People

(Reporter: nical, Assigned: nical)

References

(Blocks 1 open bug)

Details

Attachments

(5 files)

The Quad AA code has a few bugs:

  • The batching code sets the wrong flag for some of the AA segments
  • The shader incorrectly computes the position of the AA SDF by picking the loal rect after offsetting the sides. This causes the center part to always have AA applied to all of its side. This bug partially papers over the previous one and prevents AA from being applied to a subset of edges of a primitive.
  • The AA segmentation has cracks sometimes (including multiple reftests). I don't know for sure if it is caused by the T-junctions in the segmentation or if it is an artifact of the previous described issues.
  • The current segmentation only works if all segments are anti-aliased because the corners are covered by the left and right parts. If the top or bottom edge is not anti-aliased, then the side AA segments extend too far up/down.

We used to be able to select which edges get anti-aliased for linear gradient primitives. That got lost in the transition to quads and is needed for all other patterns.
This patch adds plumbing for specifying which edges to antialias with two possible configurations: with or without an axis-aligned transform. CSS primitives don't anti-alias axis-aligned primitives, but SVG primitives should (alas they currently don't).

I suspect that with upocming changes to snapping we may end up representing this distinction some other way, but with this patch, the code internally at least reflects the options that we need to eventually support correctly.

For now the most pressing concern is that primitives need to be able to not anti-alias certain edges to avoid seams within items that are segmented inot multiple primitives. This is already the case of linear and radial gradients in some situations, and will probably be needed for the segmentation of border nine-patches.

Blocks: 2015805
QA Whiteboard: [qa-triage-done-c150/b149]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: