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

Unified Diff: src/codec/SkSwizzler.cpp

Issue 1010903003: Add scanline decoding to SkCodec. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Build with no-clobbered Created 5 years, 9 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/SkSwizzler.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkSwizzler.cpp
diff --git a/src/codec/SkSwizzler.cpp b/src/codec/SkSwizzler.cpp
index 351b3be1d2722bcad89b45800334726d426dbb48..0486cf27f13b693b7435ac1d182a58e1d3eddc6a 100644
--- a/src/codec/SkSwizzler.cpp
+++ b/src/codec/SkSwizzler.cpp
@@ -263,7 +263,7 @@ SkSwizzler* SkSwizzler::CreateSwizzler(SkSwizzler::SrcConfig sc,
const SkImageInfo& info, void* dst,
size_t dstRowBytes,
SkImageGenerator::ZeroInitialized zeroInit) {
- if (kUnknown_SkColorType == info.colorType()) {
+ if (info.colorType() == kUnknown_SkColorType || kUnknown == sc) {
return NULL;
}
if (info.minRowBytes() > dstRowBytes) {
@@ -406,6 +406,7 @@ SkSwizzler::SkSwizzler(RowProc proc, const SkPMColor* ctable,
SkSwizzler::ResultAlpha SkSwizzler::next(const uint8_t* SK_RESTRICT src) {
SkASSERT(0 <= fCurrY && fCurrY < fDstInfo.height());
+ SkASSERT(fDstRow != NULL);
SkASSERT(kDesignateRow_NextMode != fNextMode);
SkDEBUGCODE(fNextMode = kConsecutive_NextMode);
@@ -414,6 +415,7 @@ SkSwizzler::ResultAlpha SkSwizzler::next(const uint8_t* SK_RESTRICT src) {
fDeltaSrc, fCurrY, fColorTable);
// Move to the next row and return the result
+ fCurrY++;
fDstRow = SkTAddOffset<void>(fDstRow, fDstRowBytes);
return result;
}
« no previous file with comments | « src/codec/SkSwizzler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698