Open Bug 1888089 (wr-fill) Opened 7 months ago Updated 3 days ago

[meta] [project] Implement path filling in WebRender

Categories

(Core :: Graphics: WebRender, task)

task

Tracking

()

People

(Reporter: nical, Unassigned)

References

(Depends on 4 open bugs, Blocks 2 open bugs)

Details

(Keywords: meta)

WebRender currently lacks a way to fill arbitrary paths. It causes them to go through the blob software fallback which is one of our most common source of performance issues.

I built a prototype in https://github.com/nical/misc/tree/master/path_renderer
This prototype contains multiple ways to fill paths:

  • Two tiled algorithms
  • Stencil-and-cover with MSAA
  • Polygon tessellation with MSAA
  • The wpf rasterizer used in accelerated canvas today.

All 4 methods only require GPU features that WebRender already relies on.

With simple scenes, stencil-and-cover has the best performance but scales rather poorly to more complex scenes.
Tiling has good performance with simple scenes and scales well to larger scenes. It also does not require MSAA which makes it easier to integrate in WebRender.
WPF is by far the slowest of the lot, followed by tessellation.

I think that the tiling approach is the best compromise. It's also a rather simple algorithm (not quite as simple stencil-and-cover, but much simpler than the other two for sure).
It supports two anti-aliasing methods:

  • analytical: high quality but suffers from conflation artifacts.
  • 4x super-sampling: lower quality but no conflation artifacts.

The safest route is to start with super-sampling.

Depends on: 1888145
Depends on: 1888147
Depends on: 1888150
Depends on: 1888217
Summary: Implement path filling in WebRender → [meta] [project] Implement path filling in WebRender
Rank: 4
Severity: N/A → S4
You need to log in before you can comment on or make changes to this bug.