DescriptionImplement a persistent uniqueID-based cache for SkImageFilter.
Add a unique ID to SkImageFilter, and use it as part
of a persistent cache of image-filtered results. This is used for
caching frame-to-frame coherent filters.
We also keep track of which filter subtrees do not reference the
src input, and use a GenID of zero for the src input in that case.
That way, subtrees which are not dependent on the filter input can be
cached independently of it.
This gives approximately a 4X speedup on
letmespellitoutforyou.com/samples/svg/filter_terrain.svg on Z620
and Nexus10. The cache key consists of the uniqueID of the filter, the
clip bounds, the CTM and the genID of the input bitmap.
Since this does not yet handle the case where the input primitives
(and part of the resulting filter tree) are unchanged, we have
to keep around the external cache for that painting case.
When the work to cache unchanging input primitives is done, the
old cache can be removed, and the new UniqueIDCache will be renamed
to Cache.
Committed: https://skia.googlesource.com/skia/+/55b6d8be997a447ef9ce0f029697677a940bfc24
Patch Set 1 #Patch Set 2 : #Patch Set 3 : Use a new generation ID for cross-process reads. #Patch Set 4 : Remove extraneous whitespace #Patch Set 5 : Remove useless #include #Patch Set 6 : Clean up destruction of the ImageFilterCache. #
Total comments: 12
Patch Set 7 : Fixed re: mtklein@'s review comments #Patch Set 8 : Changes per review comments on the SHA1 patch (377673002) #Patch Set 9 : Minor cleanup; move GenIDCache::Key to .cpp #Patch Set 10 : Update to ToT #Patch Set 11 : 100-col fixes #Patch Set 12 : Rework GPU cache to be transient #Patch Set 13 : Undo some unnecessary reformatting. #
Total comments: 8
Patch Set 14 : Changes re: Brian's comments #
Total comments: 1
Patch Set 15 : Updated to ToT #Patch Set 16 : Add a compile-time assert for tight packing of Key #Patch Set 17 : Fix 100-cols #
Total comments: 1
Patch Set 18 : Don't use UniqueID zero. #
Total comments: 2
Patch Set 19 : uint32_t -> int32_t to match sk_atomic_inc() #Patch Set 20 : Add missing #include for no-GPU build #Patch Set 21 : Bump the picture version and add backwards-compatible reading support #Patch Set 22 : Fix cross-process issue (revert those changes to HEAD^^) #
Messages
Total messages: 34 (0 generated)
|