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

Unified Diff: src/codec/SkCodec_libico.cpp

Issue 1332053002: Fill incomplete images in SkCodec parent class (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Response to comments Created 5 years, 3 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_libico.cpp
diff --git a/src/codec/SkCodec_libico.cpp b/src/codec/SkCodec_libico.cpp
index 798169d82b344902571d996d34c127818b3576e7..43460609dbd16754c7e28858eddd497060b28fc2 100644
--- a/src/codec/SkCodec_libico.cpp
+++ b/src/codec/SkCodec_libico.cpp
@@ -133,6 +133,9 @@ SkCodec* SkIcoCodec::NewFromStream(SkStream* stream) {
SkData::NewFromStream(inputStream.get(), size));
if (nullptr == data.get()) {
SkCodecPrintf("Warning: could not create embedded stream.\n");
+ // FIXME: This is a good solution if we have already created at
+ // least one valid codec. Otherwise, we may want to try to
+ // partially decode this incomplete embedded image.
break;
}
SkAutoTDelete<SkMemoryStream> embeddedStream(new SkMemoryStream(data.get()));
@@ -235,8 +238,8 @@ SkISize SkIcoCodec::onGetScaledDimensions(float desiredScale) const {
*/
SkCodec::Result SkIcoCodec::onGetPixels(const SkImageInfo& dstInfo,
void* dst, size_t dstRowBytes,
- const Options& opts, SkPMColor* ct,
- int* ptr) {
+ const Options& opts, SkPMColor* colorTable,
+ int* colorCount, int*) {
if (opts.fSubset) {
// Subsets are not supported.
return kUnimplemented;
@@ -272,7 +275,8 @@ SkCodec::Result SkIcoCodec::onGetPixels(const SkImageInfo& dstInfo,
break;
}
SkImageInfo info = dstInfo.makeAlphaType(embeddedAlpha);
- result = embeddedCodec->getPixels(info, dst, dstRowBytes, &opts, ct, ptr);
+ result = embeddedCodec->getPixels(info, dst, dstRowBytes, &opts, colorTable,
+ colorCount);
// On a fatal error, keep trying to find an image to decode
if (kInvalidConversion == result || kInvalidInput == result ||

Powered by Google App Engine
This is Rietveld 408576698