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 upRestructure compositor layers to work with iframes #2943
Conversation
hoppipolla-critic-bot
commented
Jul 28, 2014
|
Critic review: https://critic.hoppipolla.co.uk/r/2173 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 |
zwarich
commented
Jul 28, 2014
|
@bjwbell These changes make scrolling really choppy for me. |
zwarich
commented
Jul 28, 2014
|
This patch fixes it: diff --git a/src/components/compositing/compositor.rs b/src/components/compositing/compositor.rs
index 00a83df..c996c3e 100644
--- a/src/components/compositing/compositor.rs
+++ b/src/components/compositing/compositor.rs
@@ -389,7 +389,7 @@ impl IOCompositor {
let new_render_state = self.get_render_state();
self.window.set_render_state(new_render_state);
- self.composite_ready = new_render_state == IdleRenderState;
+ self.composite_ready |= new_render_state == IdleRenderState;
}
fn get_render_state(&self) -> RenderState {If we want to synchronize changes from different pipelines, we need to do that in a way that doesn't block compositing with any outstanding changes, since there will always be a pipeline of new tiles coming. |
zwarich
commented
Jul 28, 2014
|
Of course, that change breaks the new iframe test you added. |
|
If it's not one thing than it's another... I'll patch it to not break the test. |
zwarich
commented
Jul 28, 2014
|
@bjwbell At the end of the day, any synchronization based on |
|
@zwarich Added change to only synchronously wait when outputting the result to a file. The ref tests now pass and scrolling shouldn't be jerky. This doesn't solve the inherently racey issue... That should probably be addressed with a follow up PR. Like you said we need a transaction mechanism, which I don't think will be completely trivial. |
When a frame is selected via set_ids, a tree of root compositor
layers is also created, matching the tree of pipelines in the frame.
This decouples the chronological ordering dependency for parent frames
and child iframes sending CreateOrUpdateRootLayer &
CreateOrUpdateDescendentLayer messages.
Change the Compositor ready and render states to per pipeline.
This ensures the compositor doesn't composite for an epoch until
every *pipeline* in the epoch is finished rendering.
For iframes it fixes a bug where the compositor didnt wait on the
child pipeline ready state before compositing the window.
Split SetLayerClipRect into two messages, SetLayerOrigin and
SetLayerSize. This is because only the parent layout task knows
the iframe position and only the iframe layout task knows the iframe
size. The parent layout task sets the iframe origin and the iframe
layout task sets the iframe size.
Gotchas:
* layout task or script task failure on exit ("task '' failed at sending
on a closed channel"), this happens if the child iframe shares the
same script task as the parent and can be avoided by adding the
sandbox attribute to the iframe.
* The iframe_summit ref test fails on the travis-ci linux build.
It passes on the travis-ci osx build and also my local linux build.
* Synchronously wait for render only for tests
Dont wait for all pipelines to finish rendering to composite unless
outputting the result to a file. Note Compositing is racy with rendering.
| @@ -397,67 +507,128 @@ impl IOCompositor { | |||
| } | |||
| } | |||
|
|
|||
| fn create_or_update_root_layer(&mut self, layer_properties: LayerProperties) { | |||
| fn create_or_update_root_layer(&mut self, | |||
This comment has been minimized.
This comment has been minimized.
mrobinson
Aug 19, 2014
Member
This method is a little strange now and I'm not sure I understand what's going on. It used to update the layers if they existed or create them otherwise, thus the name create_or_update_root_layer. Now it seems to update the root layers in either case. Shouldn't the method be renamed to update_root_layer and the need_new_root_layer case removed?
|
This patch is pretty big, but I think it has some parts that are useful independently. For instance, perhaps it makes sense to split out a persistent root layer into another commit. This would simplify a lot of the compositor. Hopefully it is not a problem if I do that. I hope it will help move this patch forward, by allowing it to be simpler. |
|
@mrobinson @zwarich Where is this patch at? I know it was rebased by @mrobinson and working (I used it for the demo), but can we open/land it? This is required to fix our iframes-related demos :-) |
|
The first part of this PR split off here: #3179 |
|
The rest is here: #3197. |
|
Closing in favor of #3197. (Please reopen if this was incorrect.) |
bjwbell commentedJul 28, 2014
When a frame is selected via set_ids, a tree of root compositor
layers is also created, matching the tree of pipelines in the frame.
This decouples the chronological ordering dependency for parent frames
and child iframes sending CreateOrUpdateRootLayer &
CreateOrUpdateDescendentLayer messages.
Change the Compositor ready and render states to per pipeline.
This ensures the compositor doesn't composite for an epoch until
every pipeline in the epoch is finished rendering.
For iframes it fixes a bug where the compositor didnt wait on the
child pipeline ready state before compositing the window.
Split SetLayerClipRect into two messages, SetLayerOrigin and
SetLayerSize. This is because only the parent layout task knows
the iframe position and only the iframe layout task knows the iframe
size. The parent layout task sets the iframe origin and the iframe
layout task sets the iframe size.
Gotchas:
on a closed channel"), this happens if the child iframe shares the
same script task as the parent and can be avoided by adding the
sandbox attribute to the iframe.
Second time around...
@zwarich , CC @mrobinson