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

Unified Diff: src/codec/SkBmpMaskCodec.cpp

Issue 1695473002: Fix colorType/alphaType checks in SkCodec (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 4 years, 10 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/codec/SkBmpMaskCodec.h ('k') | src/codec/SkBmpStandardCodec.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkBmpMaskCodec.cpp
diff --git a/src/codec/SkBmpMaskCodec.cpp b/src/codec/SkBmpMaskCodec.cpp
index b603de9a03f81fd47b13f26dc234cb4b636c78fa..21d231b15f016987964f0e9fbc0bd084d8059ce5 100644
--- a/src/codec/SkBmpMaskCodec.cpp
+++ b/src/codec/SkBmpMaskCodec.cpp
@@ -57,25 +57,12 @@ SkCodec::Result SkBmpMaskCodec::onGetPixels(const SkImageInfo& dstInfo,
return kSuccess;
}
-bool SkBmpMaskCodec::initializeSwizzler(const SkImageInfo& dstInfo, const Options& options) {
- // Create the swizzler
- fMaskSwizzler.reset(SkMaskSwizzler::CreateMaskSwizzler(dstInfo, this->getInfo(), fMasks,
- this->bitsPerPixel(), options));
-
- if (nullptr == fMaskSwizzler.get()) {
- return false;
- }
-
- return true;
-}
-
SkCodec::Result SkBmpMaskCodec::prepareToDecode(const SkImageInfo& dstInfo,
const SkCodec::Options& options, SkPMColor inputColorPtr[], int* inputColorCount) {
- // Initialize a the mask swizzler
- if (!this->initializeSwizzler(dstInfo, options)) {
- SkCodecPrintf("Error: cannot initialize swizzler.\n");
- return SkCodec::kInvalidConversion;
- }
+ // Initialize the mask swizzler
+ fMaskSwizzler.reset(SkMaskSwizzler::CreateMaskSwizzler(dstInfo, this->getInfo(), fMasks,
+ this->bitsPerPixel(), options));
+ SkASSERT(fMaskSwizzler);
return SkCodec::kSuccess;
}
« no previous file with comments | « src/codec/SkBmpMaskCodec.h ('k') | src/codec/SkBmpStandardCodec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698