Smooth WebRender box-shadow blur and edge during a transition
Categories
(Core :: Graphics: WebRender, task)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox155 | --- | fixed |
People
(Reporter: gw, Assigned: gw)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
| Assignee | ||
Comment 1•1 month ago
|
||
Two related quantizations made an animated box-shadow (a CSS transition of the
blur radius and/or offset) look choppy rather than interpolating smoothly:
-
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. -
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).
Updated•1 month ago
|
Comment 3•1 month ago
|
||
| bugherder | ||
Updated•24 days ago
|
Description
•