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

Unified Diff: src/codec/SkJpegCodec.cpp

Issue 1287423002: Scanline decoding for bmp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix windows errors Created 5 years, 4 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/SkCodec_libpng.cpp ('k') | src/codec/SkMaskSwizzler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkJpegCodec.cpp
diff --git a/src/codec/SkJpegCodec.cpp b/src/codec/SkJpegCodec.cpp
index ed3944cc42774aa475c19d1224f7979d190258ff..d985337775599fc68188a4c3f6831467a213bd23 100644
--- a/src/codec/SkJpegCodec.cpp
+++ b/src/codec/SkJpegCodec.cpp
@@ -355,11 +355,8 @@ SkCodec::Result SkJpegCodec::onGetPixels(const SkImageInfo& dstInfo,
// If the destination is kRGB_565, the low 16 bits of SK_ColorBLACK
// will be used. Conveniently, these are zeros, which is the
// representation for black in kRGB_565.
- if (kNo_ZeroInitialized == options.fZeroInitialized ||
- kN32_SkColorType == dstInfo.colorType()) {
- SkSwizzler::Fill(dstRow, dstInfo, dstRowBytes, dstHeight - y,
- SK_ColorBLACK, nullptr);
- }
+ SkSwizzler::Fill(dstRow, dstInfo, dstRowBytes, dstHeight - y,
+ SK_ColorBLACK, nullptr, options.fZeroInitialized);
// Prevent libjpeg from failing on incomplete decode
dinfo->output_scanline = dstHeight;
@@ -516,11 +513,8 @@ public:
uint32_t rowsDecoded =
chromium_jpeg_read_scanlines(fCodec->fDecoderMgr->dinfo(), &dstRow, 1);
if (rowsDecoded != 1) {
- if (SkCodec::kNo_ZeroInitialized == fOpts.fZeroInitialized ||
- kN32_SkColorType == this->dstInfo().colorType()) {
- SkSwizzler::Fill(dstRow, this->dstInfo(), rowBytes,
- count - y, SK_ColorBLACK, nullptr);
- }
+ SkSwizzler::Fill(dstRow, this->dstInfo(), rowBytes, count - y,
+ SK_ColorBLACK, nullptr, fOpts.fZeroInitialized);
fCodec->fDecoderMgr->dinfo()->output_scanline = this->dstInfo().height();
return SkCodec::kIncompleteInput;
}
« no previous file with comments | « src/codec/SkCodec_libpng.cpp ('k') | src/codec/SkMaskSwizzler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698