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

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: Fix a test - we now draw transparent background for missing color table 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
« no previous file with comments | « src/codec/SkAndroidCodec.cpp ('k') | src/codec/SkCodecAnimation.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/codec/SkCodec.cpp
diff --git a/src/codec/SkCodec.cpp b/src/codec/SkCodec.cpp
index b6ce65e7b222ac71a16e96bc8aa282a4a7a884f6..31323f0b362194d19a7db1190c0d41bdde9106d6 100644
--- a/src/codec/SkCodec.cpp
+++ b/src/codec/SkCodec.cpp
@@ -35,9 +35,7 @@ static const DecoderProc gDecoderProcs[] = {
#ifdef SK_HAS_WEBP_LIBRARY
{ SkWebpCodec::IsWebp, SkWebpCodec::NewFromStream },
#endif
-#ifdef SK_HAS_GIF_LIBRARY
{ SkGifCodec::IsGif, SkGifCodec::NewFromStream },
-#endif
#ifdef SK_HAS_PNG_LIBRARY
{ SkIcoCodec::IsIco, SkIcoCodec::NewFromStream },
#endif
@@ -143,12 +141,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;
@@ -162,7 +154,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;
}
@@ -473,15 +467,6 @@ 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;
- }
}
}
« no previous file with comments | « src/codec/SkAndroidCodec.cpp ('k') | src/codec/SkCodecAnimation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698