Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upDiscussion: lifetime of compositor vs. constellation, and potential compositor refactoring #23179
Comments
|
/cc @asajeffrey |
|
So the idea is that on devices which support multiple windows, there'd be one compositor per window? If we have tabs, there'll be multiple top-level browsing contexts per compositor? |
Yes.
That's already the case, but only one visible at a time. But what we can't do as of now is having multiple visible top-level browsing contexts . For example, the HTML content and a HTML sidebar, or HTML content and a chrome UI in HTML. |
|
This design sounds reasonable to me. It may even make it easier to experiment with some kind of remote compositing for low-powered VR devices where we run the rest of Servo in the cloud. |
A compositor is a lot of things at once:
This set of responsibilities and behavior are not compatible with 3 features we need:
On Mac, Android and Firefox Reality, we can end up in situations where the native window doesn't exist anymore.
We want to be able to close a window and keep Servo alive (the constellation, probably not the pipelines for now).
We want to be able to have more that one window. As of now, one compositor = one window.
#13993
We want to be able to draw multiple top level document on window without having to use an iframe.
Think "chrome document" vs. "content document" for example. As of now, a compositor only has one
top level root pipeline.
#20335 (comment)
Proposed changes:
We should start by making the compositor optional, be able to shut it down, and create a new one. The constellation should be able to outlive the compositor.
Then we need to make it possible to hold multiple compositors.
And finally introduce a sub structure inside a compositor that I call "Area" which basically holds a WR document. A compositor could have multiple areas.
I'm starting by making the compositor optional. This involves quite a lot of refactoring and also changes the lifetime of the compositor and the constellation.
So before jumping too deep, I'd like to get some feedback on this proposal.