-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
Currently, the RasterCache allocates SkSurfaces tightly fitting the content being rasterized. Skia then tries to match an existing allocation in GrResourceCache using requested resolution. During a scale animation, this typically results in a resource miss. A simple scale+opacity route transition can fill up Skia's resource cache, increasing memory usage until the cache hits its limit.
One mitigation I tested was changing RasterCache to round up pixel resolutions to a multiple of 64. Increasing the tile size reduces the number of allocations needed, but has diminishing returns for small composited/raster cached content. I may send out a PR for the mitigation to see how it affects benchmarks.
A more complete solution would be using a rect packing algorithm such as https://blackpawn.com/texts/lightmaps/ to place RasterCache content on a small set of large surfaces, similar to how its done in Cobalt's OffscreenTargetManager.
I'll work on a minimal dart:ui-only test-case + RenderDoc capture for this tonight.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status