-
Notifications
You must be signed in to change notification settings - Fork 306
Various simplifications, optimizations and features related to clipping. #1679
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
Conversation
|
This change is probably easier to review by considering each commit as a separate improvement... |
This reduces a lot of memory copying and allocations, since the clip stack built each frame now just contains handles into the clip store, rather than copying the entire mask cache.
We no longer need to copy the border sources etc into the mask cache structures - they can be referenced directly from the clip sources. We also use a separate GPU cache handle for each clip now, so the ClipAddressRange code is no longer needed. This is possible since we use the GpuCache now, which doesn't need to allocate space during initialization. This also simplifies the code in the clip batcher that adds clip instances to the render targets. Add support for multiple image masks (a by-product of removing the init step of the mask cache code).
925d6ee to
fe7444e
Compare
kvark
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks sensible (and rather elegant)!
Just one note to address/answer, after which r=me
webrender/src/clip.rs
Outdated
| clips: Vec<ClipSource>, | ||
| pub mask_cache_info: MaskCacheInfo, | ||
| pub clips: Vec<ClipSource>, | ||
| pub handles: Vec<GpuCacheHandle>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why don't we want to either simply include GpuCacheHandle into ClipSource or have it stored nearby, e.g. Vec<(ClipSrouce, GpuCacheHandle)>?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did consider including it in ClipSource but it seemed a bit cleaner conceptually to separate them. No real reason it couldn't be in a tuple though!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, let's tuple it up then ;)
|
@kvark OK, pushed a commit that moves |
|
Thank you! |
|
📌 Commit e1ef408 has been approved by |
Various simplifications, optimizations and features related to clipping.
* Introduce ClipStore, an arena for storing clip sources.
This reduces a lot of memory copying and allocations, since the clip stack built each frame now just contains handles into the clip store, rather than copying the entire mask cache.
* Move remaining mask cache code into ClipSources, and simplify it.
We no longer need to copy the border sources etc into the mask cache structures - they can be referenced directly from the clip sources.
* Use a separate GPU cache handle for each clip, so ClipAddressRange code is no longer needed.
This is possible since we use the GpuCache now, which doesn't need to allocate space during initialization.
* Simplify the code in the clip batcher that adds clip instances to the render targets.
* Add support for multiple image masks (a by-product of removing the init step of the mask cache code).
* Move MaskBounds into the ClipSources (from the MaskCacheInfo struct).
* Add recycle() to free list, and support cloning weak handles.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/1679)
<!-- Reviewable:end -->
|
💔 Test failed - status-travis |
|
@bors-servo retry |
Various simplifications, optimizations and features related to clipping.
* Introduce ClipStore, an arena for storing clip sources.
This reduces a lot of memory copying and allocations, since the clip stack built each frame now just contains handles into the clip store, rather than copying the entire mask cache.
* Move remaining mask cache code into ClipSources, and simplify it.
We no longer need to copy the border sources etc into the mask cache structures - they can be referenced directly from the clip sources.
* Use a separate GPU cache handle for each clip, so ClipAddressRange code is no longer needed.
This is possible since we use the GpuCache now, which doesn't need to allocate space during initialization.
* Simplify the code in the clip batcher that adds clip instances to the render targets.
* Add support for multiple image masks (a by-product of removing the init step of the mask cache code).
* Move MaskBounds into the ClipSources (from the MaskCacheInfo struct).
* Add recycle() to free list, and support cloning weak handles.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/1679)
<!-- Reviewable:end -->
|
☀️ Test successful - status-travis |
This reduces a lot of memory copying and allocations, since the clip stack built each frame now just contains handles into the clip store, rather than copying the entire mask cache.
We no longer need to copy the border sources etc into the mask cache structures - they can be referenced directly from the clip sources.
This is possible since we use the GpuCache now, which doesn't need to allocate space during initialization.
This change is