aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkImageDecoder.h
diff options
context:
space:
mode:
authorGravatar scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-07-09 15:45:14 +0000
committerGravatar scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-07-09 15:45:14 +0000
commitbc69ce982f8374742ca910587485f0d741350c2d (patch)
treefb7306569999904bb13f00cf612f8665f9effa78 /include/core/SkImageDecoder.h
parent4b60dbe661feadc276f911ee6dfc2058e5aea7ca (diff)
Remove bitmap reuse from SkImageDecoder.
Now that Android is using an SkBitmap::Allocator to reuse bitmap memory, remove the unnecessary code to handle bitmap reuse inside the decoders themselves. Leaves in the code for bitmap reuse in decodeSubset, which still may reuse bitmaps, and cropBitmap, which is called by decodeSubset. R=djsollen@google.com Review URL: https://codereview.chromium.org/17620004 git-svn-id: http://skia.googlecode.com/svn/trunk@9931 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core/SkImageDecoder.h')
-rw-r--r--include/core/SkImageDecoder.h23
1 files changed, 16 insertions, 7 deletions
diff --git a/include/core/SkImageDecoder.h b/include/core/SkImageDecoder.h
index 360f03acb6..67c8257827 100644
--- a/include/core/SkImageDecoder.h
+++ b/include/core/SkImageDecoder.h
@@ -117,10 +117,10 @@ public:
Peeker* getPeeker() const { return fPeeker; }
Peeker* setPeeker(Peeker*);
- /** \class Peeker
+ /** \class Chooser
- Base class for optional callbacks to retrieve meta/chunk data out of
- an image as it is being decoded.
+ Base class for optional callbacks to choose an image from a format that
+ contains multiple images.
*/
class Chooser : public SkRefCnt {
public:
@@ -219,11 +219,20 @@ public:
* to pref if possible. Whether a conversion is feasible is
* tested by Bitmap::canCopyTo(pref).
- note: document use of Allocator, Peeker and Chooser
+ If an SkBitmap::Allocator is installed via setAllocator, it will be
+ used to allocate the pixel memory. A clever allocator can be used
+ to allocate the memory from a cache, volatile memory, or even from
+ an existing bitmap's memory.
+
+ If a Peeker is installed via setPeeker, it may be used to peek into
+ meta data during the decode.
+
+ If a Chooser is installed via setChooser, it may be used to select
+ which image to return from a format that contains multiple images.
*/
- bool decode(SkStream*, SkBitmap* bitmap, SkBitmap::Config pref, Mode, bool reuseBitmap = false);
- bool decode(SkStream* stream, SkBitmap* bitmap, Mode mode, bool reuseBitmap = false) {
- return this->decode(stream, bitmap, SkBitmap::kNo_Config, mode, reuseBitmap);
+ bool decode(SkStream*, SkBitmap* bitmap, SkBitmap::Config pref, Mode);
+ bool decode(SkStream* stream, SkBitmap* bitmap, Mode mode) {
+ return this->decode(stream, bitmap, SkBitmap::kNo_Config, mode);
}
/**