Closed Bug 1589402 Opened 5 years ago Closed 5 years ago

Stop rounding rounded rects in layout space

Categories

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

defect

Tracking

()

RESOLVED FIXED
mozilla72
Tracking Status
firefox72 --- fixed

People

(Reporter: aosmond, Assigned: aosmond)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

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

https://searchfox.org/mozilla-central/rev/97976753a21c1731e18177de9e5ce78ea3b3da2d/gfx/webrender_bindings/WebRenderTypes.h#600

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.

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:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=85d62cb4f10c541080273913f89470c2cae29838

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:

https://searchfox.org/mozilla-central/source/gfx/wr/webrender/res/ps_text_run.glsl#111-112
https://searchfox.org/mozilla-central/source/gfx/wr/webrender/res/ps_text_run.glsl#128

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 aosmond@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/08eb2c23eefa
Stop rounding complex clip rects in layout space. r=jrmuizel
Status: ASSIGNED → RESOLVED
Closed: 5 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.

Attachment

General

Created:
Updated:
Size: