Add support for filling paths in WebRender
Categories
(Core :: Graphics: WebRender, task, P3)
Tracking
()
People
(Reporter: nical, Assigned: nical)
References
Details
Attachments
(15 external files, 1 obsolete file)
The idea is to integrate the tiling algorithm I developed in https://codeberg.org/nical/misc/src/branch/main/path_renderer/renderers/tiling
At first it will only be used for CSS clip paths, we'll then extend it to support more common fills like SVG fills.
| Assignee | ||
Comment 1•1 month ago
|
||
| Assignee | ||
Comment 2•1 month ago
|
||
It contains only curve flattening implementations for cubic and quadratic bézier curves for now.
| Assignee | ||
Comment 3•1 month ago
|
||
| Assignee | ||
Comment 4•1 month ago
|
||
| Assignee | ||
Comment 5•1 month ago
|
||
clip.rs is a pretty large file and polygon.rs is the only place where it is used. Also move the related tests that were in util.rs.
| Assignee | ||
Comment 6•1 month ago
|
||
| Assignee | ||
Comment 7•1 month ago
|
||
Port of the tiling path renderer from https://codeberg.org/nical/misc/src/branch/main/path_renderer/renderers/tiling without occlusion culling, opaque batches and the point buffer. Curves are flattened with the bezier module, and segments are clipped to the region that affects the target before binning so that huge coordinates cannot cause the binning to walk across millions of tiles.
This is not used yet.
| Assignee | ||
Comment 8•1 month ago
|
||
Path tile edges are stored in a dedicated RGBA8 texture, one edge per texel, so that the fragment shader gets them unpacked by the texture unit. It is shared by all of the paths of the frame and is empty until path clips are rasterized.
| Assignee | ||
Comment 9•1 month ago
|
||
Port of the tiling path renderer's shader, with area coverage anti-aliasing only. The tile rasterization code lives in path_tile.glsl so that it can later be included by other shaders.
Path tiles are drawn at the end of the clip masks, with the premultiplied dest-out blend mode in color targets. In alpha targets they use the multiply blend mode instead, because SWGL's R8 targets have no fragment alpha to blend with. No path tiles are produced yet.
| Assignee | ||
Comment 10•1 month ago
|
||
Path clips on quad render tasks and clip masks push a path clip sub-task. The path is tiled when the task is added to its render target, so that the tiles can be positioned relative to the task and their edges go straight into the frame's edge buffer.
When the clip's transform to the raster space can't be computed, the clip falls back to the bounds of the path.
| Assignee | ||
Comment 11•1 month ago
|
||
Wrench yaml clips get a path property with a rect, a fill rule and path data in a subset of the SVG path syntax.
| Assignee | ||
Comment 12•1 month ago
|
||
Instead of rasterizing a mask image on the CPU, the path is built with SVGPathData and sent to WebRender as a path clip. This is behind the gfx.webrender.path-clips pref.
| Assignee | ||
Comment 13•1 month ago
|
||
Analytical anti-aliasing has conflation artifacts where edges overlap, so path
tiles are rasterized with 8 samples per pixel by default, and 4 on Android.
The gfx.webrender.path-aa.samples pref selects the mode. Software WebRender
only builds the ssaa4 variant.
| Assignee | ||
Comment 14•1 month ago
|
||
clip-path: path() and shape() are rendered with WebRender path clips, which
anti-alias differently from the mask images, so the fuzziness of the affected
tests is adjusted. corner-shape-superellipse-concave is affected through its
reference, which uses clip-path: path().
| Assignee | ||
Comment 15•1 month ago
|
||
Comment 16•1 month ago
|
||
Comment 17•1 month ago
|
||
Comment 18•1 month ago
|
||
Reverted this because it was causing multiple failures.
| Assignee | ||
Comment 19•1 month ago
|
||
Looks like a recent bug in the DL interners my last try push was green. It's the same reason bug 2078462 got backed out. Since Glenn is working on that I'll re-land the interner-related parts of the stack after he manages to land bug 2078462.
| Assignee | ||
Updated•1 month ago
|
Comment 20•1 month ago
|
||
Comment 21•1 month ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/00319bcc3dc7
https://hg.mozilla.org/mozilla-central/rev/29afcd8a2051
https://hg.mozilla.org/mozilla-central/rev/acf80e161a97
https://hg.mozilla.org/mozilla-central/rev/1352dc7254db
https://hg.mozilla.org/mozilla-central/rev/9391f7bf894c
https://hg.mozilla.org/mozilla-central/rev/f757f451893b
https://hg.mozilla.org/mozilla-central/rev/c05b781b383e
Comment 22•28 days ago
|
||
Fixes use of deprecated constant std::u16::MAX: replaced by the MAX
associated constant on this type
Comment 23•27 days ago
|
||
Comment 24•26 days ago
|
||
| bugherder | ||
Comment 25•21 days ago
|
||
Comment 26•20 days ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/2d3aee1d91ec
https://hg.mozilla.org/mozilla-central/rev/dbd5e64ae8b4
https://hg.mozilla.org/mozilla-central/rev/24aa24c5599c
https://hg.mozilla.org/mozilla-central/rev/3ecb317dffbd
https://hg.mozilla.org/mozilla-central/rev/02d75c12e299
https://hg.mozilla.org/mozilla-central/rev/b8ca6a7b6443
https://hg.mozilla.org/mozilla-central/rev/d5a49816e942
Comment 27•15 days ago
|
||
Comment on attachment 9653662 [details]
Bug 2078306 - Enable WebRender path rendering by default. r=#gfx-reviewers
Revision D331231 was moved to bug 2088007. Setting attachment 9653662 [details] to obsolete.
| Assignee | ||
Comment 28•14 days ago
|
||
Moved the rest to other bugs.
Updated•14 days ago
|
Description
•