Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(452)

Unified Diff: src/images/SkImageDecoder_libwebp.cpp

Issue 17620004: Remove bitmap reuse from SkImageDecoder. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Add documentation. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/images/SkImageDecoder_libpng.cpp ('k') | src/images/SkImageDecoder_wbmp.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/images/SkImageDecoder_libwebp.cpp
diff --git a/src/images/SkImageDecoder_libwebp.cpp b/src/images/SkImageDecoder_libwebp.cpp
index 9cf84493ad89b4c555539fc0b24825a212b24a5d..b0fa7f7053d36d7050dbbd3fd407fa1329bead06 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");
}
« no previous file with comments | « src/images/SkImageDecoder_libpng.cpp ('k') | src/images/SkImageDecoder_wbmp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698