mirror of
https://github.com/servo/servo
synced 2026-05-09 08:32:31 +02:00
This is the last major change before we can try to implement support for multiple windows in Servo. This change makes it so that each `WebView` (via `WebViewBuilder`) takes the `RenderingContext` as an argument, rather than `Servo` (via `ServoBuilder`) as a whole. In the compositor, when registering the `RenderingContext`, if a `Painter` is found for it, it is returned. Otherwise, a new `Painter` (and WebRender instance) is created for it. There is currently no way to unregister a `RenderingContext`. We should come up with a good metric for when is the best time to clean up `Painter`s and WebRender instances for defunct `RenderingContext`s. This could perhaps be done via a `Weak` handle to the `RenderingContext`. Testing: This should not really change observable behavior, so should be covered by existing tests. Fixes: #13995 Closes: #40261 Signed-off-by: Martin Robinson <mrobinson@igalia.com>