DescriptionBreak up SkLazyPixelRef functionally into class hierarchy.
The reason for this CL is to allow greater decoder flexibility.
Chrome currently uses its own decoding functions. These allow for
greater flexibility in dealing with images with multiple frames or
partial data. The DecodeProc function was not flexible enough to
handle these. Instead of asking the decoder to squeeze everything
into the DecodeProc, we now ask the downstream library to inherit from
SkCachingPixelRef. If WebKit's LazyDecodingPixelRef is re-tooled to
inherit from SkCachingPixelRef, then it can make use of Skia's caching
ability while still allowing it to deal with multiple frames, scaling,
subsetting, and partial data.
- The abstract SkCachingPixelRef class handles caching the decoded
data in a SkScaledImageCache. This class relies on the virtual
functions onDecodeInfo() and onDecode() to do the actual decoding
of data.
- The SkLazyCachingPixelRef class is derived from SkCachingPixelRef.
It provides an implementation of onDecodeInfo() and onDecode() in
terms of calls to a SkBitmapFactory::DecodeProc function. It also
provides an Install() static method which installs a new
SkLazyCachingPixelRef into a SkBitmap.
SkLazyCachingPixelRef exists for two reasons: to test
SkCachingPixelRef within Skia and as an example for downstream
developers to make their own classes that inherit from
SkCachingPixelRef.
- The CachedDecodingPixelRefTest was updated to test the
SkLazyCachingPixelRef class and indirectly the SkCachingPixelRef
class.
BUG=
Committed: http://code.google.com/p/skia/source/detail?r=12149
Patch Set 1 #
Total comments: 35
Patch Set 2 : response to scroggo #Patch Set 3 : lint nits #
Total comments: 8
Patch Set 4 : more nits #Patch Set 5 : Use SkImageInfo #
Total comments: 6
Patch Set 6 : changes for reed and scroggo #
Total comments: 3
Patch Set 7 : unit test with lockless SkScaledImageCache #Patch Set 8 : remove SkCachingPixelRef::fCache #
Total comments: 4
Patch Set 9 : suggestions from reed #Patch Set 10 : remvoe explicit #
Total comments: 3
Patch Set 11 : getInfo change #
Total comments: 16
Patch Set 12 : changes from scroggo #
Total comments: 4
Patch Set 13 : mike's ideas #Patch Set 14 : last change #
Messages
Total messages: 28 (0 generated)
|