Closed Bug 1589402 Opened 4 years ago Closed 4 years ago

Stop rounding rounded rects in layout space


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




Tracking Status
firefox72 --- fixed


(Reporter: aosmond, Assigned: aosmond)


(Blocks 1 open bug)



(1 file)

We round rounded rect's in layout space, which we shouldn't do:

We also snap the bounds and clip for text primitives during scene building. This doesn't make much sense, because it doesn't affect the glyph positions, and these clips are mostly informative (e.g. the text definitely fits in this rect) rather than prescriptive (e.g. please draw the text here). The individual glyph points are what are important, and those are currently unaffected by snapping. To be consistently, we should just not snap text primitives so that it can accurately predict whether or not a primitive is visible.

See Also: → 1555376

This is failing one reftest severely, an entire pixel jump, when I would not have expected it. It appears that rounding out instead of snapping fixes these:

Which makes sense, in the vein of the local rect and clip rect of a text run should be conservative.... However, the glyph offset in an absolute sense has not changed with these patches, only the relative position has. In the shader we have:

Which snap the relative position in the text run. This will result in completely different results depending on how the primitive is snapped. This may account for the difference seen (unconfirmed).

Let's repurpose this just for tracking the rounded rect issue given wr-snapperific landed and ran into its own issues with not snapping the primitives.

Summary: Stop snapping text primitives and rounding rounded rects in layout space → Stop rounding rounded rects in layout space

We already snap the complex clip rects during scene building, taking
into account any necessary transforms and device pixel scaling. Just
like normal clips, we shouldn't round in layout space.

Pushed by
Stop rounding complex clip rects in layout space. r=jrmuizel
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla72
Blocks: wr-snap
No longer depends on: wr-snap
You need to log in before you can comment on or make changes to this bug.