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

Unified Diff: src/codec/SkCodec.cpp

Issue 2045293002: Add support for multiple frames in SkCodec (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Various fixes Created 4 years, 2 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
Index: src/codec/SkCodec.cpp
diff --git a/src/codec/SkCodec.cpp b/src/codec/SkCodec.cpp
index 84afc2bdee282b598b76f6f75234d276339712e6..c9b2d5a91fa4ff26a91a8527c4f567c588a47a67 100644
--- a/src/codec/SkCodec.cpp
+++ b/src/codec/SkCodec.cpp
@@ -142,12 +142,6 @@ SkCodec::SkCodec(const SkEncodedInfo& info, const SkImageInfo& imageInfo, SkStre
SkCodec::~SkCodec() {}
bool SkCodec::rewindIfNeeded() {
- if (!fStream) {
- // Some codecs do not have a stream. They may hold onto their own data or another codec.
- // They must handle rewinding themselves.
- return true;
- }
-
// Store the value of fNeedsRewind so we can update it. Next read will
// require a rewind.
const bool needsRewind = fNeedsRewind;
@@ -161,7 +155,9 @@ bool SkCodec::rewindIfNeeded() {
// startIncrementalDecode will need to be called before incrementalDecode.
fStartedIncrementalDecode = false;
- if (!fStream->rewind()) {
+ // Some codecs do not have a stream. They may hold onto their own data or another codec.
+ // They must handle rewinding themselves.
+ if (fStream && !fStream->rewind()) {
return false;
}
@@ -472,14 +468,5 @@ void SkCodec::fillIncompleteImage(const SkImageInfo& info, void* dst, size_t row
fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, sampler);
break;
}
- case kOutOfOrder_SkScanlineOrder: {
- SkASSERT(1 == linesRequested || this->getInfo().height() == linesRequested);
- const SkImageInfo fillInfo = info.makeWH(fillWidth, 1);
- for (int srcY = linesDecoded; srcY < linesRequested; srcY++) {
- fillDst = SkTAddOffset<void>(dst, this->outputScanline(srcY) * rowBytes);
- fill_proc(fillInfo, fillDst, rowBytes, fillValue, zeroInit, sampler);
- }
- break;
- }
}
}

Powered by Google App Engine
This is Rietveld 408576698