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 upcompositing: Move compositing off the main thread. #4271
Conversation
hoppipolla-critic-bot
commented
Dec 7, 2014
|
Critic review: https://critic.hoppipolla.co.uk/r/3409 This is an external review system which you may optionally use for the code review of your pull request. In order to help critic track your changes, please do not make in-place history rewrites (e.g. via |
|
No OS specific stuff was needed because GLFW supplies the necessary functions. This was nice. |
Because the compositor no longer runs on the main thread, it can now use plain old Rust channels for communication, and the main thread instead receives the special "proxy" treatment. This change also makes the compositor entirely optional; in headless mode, no compositor is started at all. This change will allow us to support multiple windows, since those must have separate compositors. It should also improve our event dispatch latency, since even less runs on the main thread, and we can handle events while waiting for buffer swaps. Additionally, this patch refactors many of the task startup functions, which took too many arguments, to use initialization structures. This makes the code easier to read. Closes #4228.
|
@pcwalton I checked out your branch, but the running the ref-tests hang on linux, and pressing escape or clicking close on about-mozilla.html gives the following: task '' panicked at 'You should have disposed of the pixmap properly with destroy()! This pixmap will leak!', /home/gw/.cargo/git/checkouts/rust-layers-3d9d5f0b4e4d9002/master/src/platform/linux/surface.rs:206 |
|
@pcwalton I had a brief look at this. The root of the problem appears to be that compositor.shutdown() is never called with this patch. This means that forget_all_tiles() isn't called, resulting in the panic above. If I comment out the panic!() when dropping a leaked surface, then the ref-tests run and pass. With that change, there is another panic that occurs when closing the window, but I suspect this will be solved when a fix is made to shutdown the compositor as mentioned above. |
|
@glennw Glutin has landed while this patch was outstanding. Is there a way to push events to the event queue from another thread with it? |
|
@pcwalton Do you just need to wake up the event queue from another thread? You can use the glutin WindowProxy interface for that. If you need something more than just a wakeup event, let me know what's required and I'll add it. |
|
@pcwalton I think this just needs to be rebased and updated for glutin based on my last comment / question above. |
|
@pcwalton Sounds like this should be easy to land. |
|
Is this PR even relevant with compositor being |
|
Yes. We will need this in order to support multiple windows, for example. |
|
@pcwalton Would it help if we split this branch in more commits? I can try to separate this:
|
|
I think that's worth doing independently of this PR. |
|
@Ms2ger Yes that's what I was |
Introduce structs for compositing and script task constructors' arguments Extracted from @pcwalton's #4271. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7645) <!-- Reviewable:end -->
|
Things I remarked so far:
|
|
@pcwalton Should we close this and re-open it when you have time to look at this again? |
pcwalton commentedDec 7, 2014
Because the compositor no longer runs on the main thread, it can now use
plain old Rust channels for communication, and the main thread instead
receives the special "proxy" treatment. This change also makes the
compositor entirely optional; in headless mode, no compositor is started
at all.
This change will allow us to support multiple windows, since those must
have separate compositors. It should also improve our event dispatch
latency, since even less runs on the main thread, and we can handle
events while waiting for buffer swaps.
Additionally, this patch refactors many of the task startup functions,
which took too many arguments, to use initialization structures. This
makes the code easier to read.
Closes #4228.
r? @glennw