DescriptionMake SkBitmapCache remove invalid bitmaps from the SkResourceCache.
This adds SkResourceCache::Remove() which will remove a resource from
its cache. The resource is required to be unlocked at the time Remove()
is called.
Then SkBitmapCache::Find() makes use of this to Remove() bitmaps from
the cache whose pixels have been evicted. This allows the bitmap to be
re-added to the cache with pixels again.
After this change, background a tab (and discarding all the bitmaps'
contents) no longer disables image caching for those discarded images
once the tab is visible again.
BUG=skia:2926
NOTRY=true
Committed: https://skia.googlesource.com/skia/+/790ffe3feb90370318f42b28eb9c6af6e38cd4f9
Patch Set 1 #
Total comments: 5
Patch Set 2 : cache: remove-purgeRec #Patch Set 3 : cache: doubleassert #Patch Set 4 : cache: doubleassert #
Total comments: 2
Patch Set 5 : cache: nit #Patch Set 6 : cache: addtestbehindif0 #Patch Set 7 : cache: #
Messages
Total messages: 26 (8 generated)
|