Share the WebRender instance between windows (using a WR "document" per window) when the GL context is shared
Categories
(Core :: Graphics: WebRender, task, P3)
Tracking
()
People
(Reporter: mstange, Unassigned)
References
(Blocks 2 open bugs)
Details
In WebRender Firefox, each new window currently comes with a fair amount of overhead: Extra threads (1 render backend thread, 2 scene builder threads), a new texture cache, and probably a bunch of other things. It would make sense to share all of these things between windows.
The renderer thread is already shared between windows, and windows are rendered consecutively.
On platforms where we share a GL context between multiple windows, sharing all those WR resources should be possible using the WR "document" API: There would be one WR instance per GL context (usually just one, except in multi-GPU configurations), and each window would be a "document" that has its own OS compositor.
This should make WR windows lightweight enough that we can use them even for tiny things such as tooltips or menus.
It would also help a lot on Android, where each tab is a "window" (see bug 1619409).
Updated•4 years ago
|
Comment 1•4 years ago
|
||
We've discussed deprecating / removing the document API from WR previously - I'd like to discuss this further before we move ahead with any plans based on the above.
Comment 2•4 years ago
|
||
We discussed this briefly in matrix. The general idea is to keep the document API, but restrict it by allowing only a single document to be drawn to a given framebuffer / OS compositor. This would allow the sharing mentioned above, while allowing us to remove the WR complexity related to documents with different origins / z-indices in the same render.
Updated•3 years ago
|
Description
•