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 up[RFC] Simplifying the clipping API. #2551
Comments
|
cc @jrmuizel too |
|
This sounds good to me, at least in theory. It should be much more in line with the display list representation that gecko produces. I have a clipping rewrite already basically done that uses the ClipChain API to basically do a 1:1 mapping from gecko clips to WR clips and is much cleaner. However the last time I rebased it it was showing some unexpected failures on a try push which I haven't had time to debug. I suspect now it might be because of the partially implemented support WR has for applying clips to stacking contexts. At any rate, I'm happy to pick up that work again once I'm done with the current APZ/RenderBackend changes. |
|
It seems like a good first step to allow clipping stacking context contents and then see how it affects Gecko. Adding constraints to how you can apply clips might make the API quite a bit more complicated, but if it leads to important optimizations, it's probably worth it. |
|
This happened. |
This is a writeup of a conversation I had with @mstange. I'll try to summarize what we discussed, and list what I think would change in WR code.
One of the things that complicates drawing a Picture in local space is that clips that affect the Picture can be defined in other coordinate spaces, due to the way ancestor clip-scroll nodes can be referenced. See #2533 for details.
Gecko doesn't actually require this. The Gecko requirements for clipping are that:
Previously, this was not really feasible in WR, because we didn't support clip masks on stacking contexts. Now that stacking context blits are drawn as brush primitives, we do (mostly) support this, and expanding it to support in all cases should be trivial (more details below).
If we were to change WR such that it supports clipping the way Gecko uses (that is, local clips on primitives, and ancestor clips on stacking contexts), that has the potential to:
These are the steps that I envisage we'd take:
@mstange @mrobinson @staktrace @kvark Does that sound like a correct summary? Any corrections / thoughts / questions?