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 upVarious simplifications, optimizations and features related to clipping. #1679
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).
|
Looks sensible (and rather elegant)! |
| clips: Vec<ClipSource>, | ||
| pub mask_cache_info: MaskCacheInfo, | ||
| pub clips: Vec<ClipSource>, | ||
| pub handles: Vec<GpuCacheHandle>, |
This comment has been minimized.
This comment has been minimized.
kvark
Sep 11, 2017
Member
why don't we want to either simply include GpuCacheHandle into ClipSource or have it stored nearby, e.g. Vec<(ClipSrouce, GpuCacheHandle)>?
This comment has been minimized.
This comment has been minimized.
glennw
Sep 11, 2017
Author
Member
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!
This comment has been minimized.
This comment has been minimized.
|
@kvark OK, pushed a commit that moves |
|
Thank you! |
|
|
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 -->
|
|
|
@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 -->
|
|
glennw commentedSep 8, 2017
•
edited by larsbergstrom
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