Currently text blobs are cached in the GPU process in the
ServiceTransferCache during OOP raster. This approach has 2 shortcomings:
1) While it gives us cache hits in skia's internal caching keyed on these
blobs, we still reserialize the blobs each time. This is because the
client side tracking of an entry in ClientTransferCache can get more
expensive than serializing the entry itself for these small entries.
2) The ServiceTransferCache budget is based on the assumption that it will
be used for images, which is much larger than needed for this use-case.
And because the eviction is also only done when we hit the cache limit,
even if the renderer creating the entries is now invisible, the cache gets
filled with stale data that may have already been purged on the client
and will never be reused.
This change adds a new client driven cache for these paint data type (text
blobs and paths), with a much smaller budget and something that is cleared
during our normal context idle cleanup or on visibility change. Lookup and
additions to the cache are also slightly cheaper than transfer cache since
it avoids allocating discardable handles for cross process ref-counting
and the need to track entries which need to be unref-ed after every raster.
TBR=tsepez@chromium.orgR=enne@chromium.org, piman@chromium.org
Change-Id: Ibc4039ec5ab20e45c1ae67aec20367c20371458f
Bug: 898910,894200
Reviewed-on: https://chromium-review.googlesource.com/c/1321190
Commit-Queue: Khushal <khushalsagar@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606400}