New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compositor: When WebRender is in use, only composite on new WebRender frames. #10936
Conversation
frames. Scheduling composition on scroll and so forth is unnecessary and can cause us to miss frames if the code happens to start the composition while the WebRender backend is still in the process of preparing the frame. This is most easily seen when scrolling in full-screen mode in release builds on Mac. Closes servo#9879.
The reason why syscalls affected how often we ran into this bug is presumably that entering the kernel would tend to induce the scheduler to switch to the WebRender thread before composition occurred, which would let the WebRender backend win the race more often. |
I think this code needs a time-series diagram showing the messages sent and received by the different threads over the life of a single frame. It would help me understand whether my questions below even make sense :).
I'm just a curious bystander so feel free to ignore these questions, but I do think making webrender act differently here is making me even more confused :/. |
It always is implicitly sync'd to vsync because the swap interval is 1.
Sort of. There shouldn't be any user-visible difference. But in the non-WR case, the compositor is responsible for redisplaying tiles after a scroll, while in the WR case the WR backend thread is responsible for that.
Without this change, with WebRender on, when a scroll happens causing a previously rendered frame N to transition to N+1, sometimes frame N will be rendered (
Not really. |
Ok, thanks for the explanation. I've reread the code, and I'm summarizing the new state as I understand it - please let me know if it makes sense. If so, I'll try to put together a PR with some comments around this :). If Webrender is enabled and an OS event occurs:
If webrender is enabled and a resize occurs on OS X:
Anyhow, other than the question in step 5 above, I think this all makes sense, and is good improvement for the webrender case. I feel like the non-webrender case could use some cleanup, but I'll look into that myself. |
Refresh means that the OS wants us to redraw the window. So yes, it should trigger a WR repaint. |
Right, but why not just set composition_request to CompositeNow, and let the check at the end of handle_events do the composition? |
Yeah, I guess that would work too. |
Nice find! |
@bors-servo r+ |
📌 Commit ed90011 has been approved by |
compositor: When WebRender is in use, only composite on new WebRender frames. Scheduling composition on scroll and so forth is unnecessary and can cause us to miss frames if the code happens to start the composition while the WebRender backend is still in the process of preparing the frame. This is most easily seen when scrolling in full-screen mode in release builds on Mac. Closes #9879. r? @glennw cc @paulrouget cc @tschneidereit <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10936) <!-- Reviewable:end -->
💔 Test failed - windows |
@bors-servo retry
|
⚡ Previous build results for arm32, linux-dev are reusable. Rebuilding only android, arm64, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt, windows... |
☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt, windows |
Just tried this out. Seems to be a lot smoother. Nice work! |
…ender. I accidentally removed this code in servo#10936.
compositing: Perform animation-related compositing operations in WebRender. I accidentally removed this code in #10936. Fixes transitions. r? @glennw <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10993) <!-- Reviewable:end -->
compositing: Perform animation-related compositing operations in WebRender. I accidentally removed this code in #10936. Fixes transitions. r? @glennw <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10993) <!-- Reviewable:end -->
compositing: Perform animation-related compositing operations in WebRender. I accidentally removed this code in #10936. Fixes transitions. r? @glennw <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10993) <!-- Reviewable:end -->
Scheduling composition on scroll and so forth is unnecessary and can
cause us to miss frames if the code happens to start the composition
while the WebRender backend is still in the process of preparing the
frame. This is most easily seen when scrolling in full-screen mode in
release builds on Mac.
Closes #9879.
r? @glennw
cc @paulrouget
cc @tschneidereit
This change is