Closed Bug 2057384 Opened 1 month ago Closed 1 month ago

Smooth WebRender box-shadow blur and edge during a transition

Categories

(Core :: Graphics: WebRender, task)

task

Tracking

()

RESOLVED FIXED
155 Branch
Tracking Status
firefox155 --- fixed

People

(Reporter: gw, Assigned: gw)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

No description provided.

Two related quantizations made an animated box-shadow (a CSS transition of the
blur radius and/or offset) look choppy rather than interpolating smoothly:

  1. The blur mask sigma was rounded to the nearest integer before being used as
    the blur std-dev and as part of the mask cache key. A blur transition
    therefore stepped between only ~3 discrete cached masks, so the blur
    appeared to pop in near the end of the transition. Keep the sigma at full
    sub-pixel precision, computed at the final mask resolution (after both the
    MAX_BLUR_STD_DEVIATION downscale and the to_cache_size safety cap); the mask
    cache key still buckets it to 1/60px via Au so static shadows still dedupe.

  2. The nine-patch shader mapped UV=1.0 to the integer atlas allocation edge
    (round(alloc_size * content_scale)). The sub-texel difference between the
    true content extent and its rounded allocation shifted the nine-patch
    registration whenever the mask size stepped as the blur animated, producing
    a small (~0.3px) non-monotonic jitter of the shadow edge. Pass the true
    device-space content extent to the shader and map UV=1.0 to it, rounding the
    atlas allocation up so the content edge always lies inside the entry (mapping
    to a point outside the entry would sample a neighbouring atlas allocation).

Assignee: nobody → mozilla
Status: NEW → ASSIGNED
Blocks: 2001865
Blocks: 2002194
Pushed by gwatson@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/e4182afaac1e https://hg.mozilla.org/integration/autoland/rev/c2d47a8efce9 Smooth WebRender box-shadow blur and edge during a transition r=gfx-reviewers,nical
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 155 Branch
QA Whiteboard: [qa-triage-done-c156/b155]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: