diff options
author | 2013-07-09 15:45:14 +0000 | |
---|---|---|
committer | 2013-07-09 15:45:14 +0000 | |
commit | bc69ce982f8374742ca910587485f0d741350c2d (patch) | |
tree | fb7306569999904bb13f00cf612f8665f9effa78 /src/images/SkImageDecoder_libwebp.cpp | |
parent | 4b60dbe661feadc276f911ee6dfc2058e5aea7ca (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 'src/images/SkImageDecoder_libwebp.cpp')
-rw-r--r-- | src/images/SkImageDecoder_libwebp.cpp | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/images/SkImageDecoder_libwebp.cpp b/src/images/SkImageDecoder_libwebp.cpp index 9cf84493ad..b0fa7f7053 100644 --- a/src/images/SkImageDecoder_libwebp.cpp +++ b/src/images/SkImageDecoder_libwebp.cpp @@ -412,25 +412,16 @@ bool SkWEBPImageDecoder::onDecode(SkStream* stream, SkBitmap* decodedBitmap, const int sampleSize = this->getSampleSize(); SkScaledBitmapSampler sampler(origWidth, origHeight, sampleSize); + if (!setDecodeConfig(decodedBitmap, sampler.scaledWidth(), + sampler.scaledHeight())) { + return false; + } // If only bounds are requested, done if (SkImageDecoder::kDecodeBounds_Mode == mode) { - if (!setDecodeConfig(decodedBitmap, sampler.scaledWidth(), - sampler.scaledHeight())) { - return false; - } return true; } - // No Bitmap reuse supported for this format - if (!decodedBitmap->isNull()) { - return false; - } - if (!setDecodeConfig(decodedBitmap, sampler.scaledWidth(), - sampler.scaledHeight())) { - return false; - } - if (!this->allocPixelRef(decodedBitmap, NULL)) { return return_false(*decodedBitmap, "allocPixelRef"); } |