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

Unified Diff: src/codec/SkWebpCodec.cpp

Issue 1332053002: Fill incomplete images in SkCodec parent class (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/SkWebpCodec.cpp
diff --git a/src/codec/SkWebpCodec.cpp b/src/codec/SkWebpCodec.cpp
index ccf49649edb30e669c1b497f94b0e3cb69eeec0d..5a0753c731567a75b4813ce1e943538c2f28aa6c 100644
--- a/src/codec/SkWebpCodec.cpp
+++ b/src/codec/SkWebpCodec.cpp
@@ -231,10 +231,10 @@ SkCodec::Result SkWebpCodec::onGetPixels(const SkImageInfo& dstInfo, void* dst,
while (true) {
const size_t bytesRead = stream()->read(buffer, BUFFER_SIZE);
if (0 == bytesRead) {
- // FIXME: Maybe this is an incomplete image? How to decide? Based
- // on the number of rows decoded? We can know the number of rows
- // decoded using WebPIDecGetRGB.
- return kInvalidInput;
+ int rowsDecoded;
+ WebPIDecGetRGB(idec, &rowsDecoded, NULL, NULL, NULL);
+ this->setIncompleteScanlines(dstDimensions.height() - rowsDecoded);
+ return kIncompleteInput;
}
switch (WebPIAppend(idec, buffer, bytesRead)) {

Powered by Google App Engine
This is Rietveld 408576698