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

Side by Side Diff: src/codec/SkPngCodec.cpp

Issue 2402063002: Report 0 rowsDecoded for no rows (SkPngCodec interlaced) (Closed)
Patch Set: rebase 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 unified diff | Download patch
« no previous file with comments | « no previous file | tests/CodecTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkCodecPriv.h" 9 #include "SkCodecPriv.h"
10 #include "SkColorPriv.h" 10 #include "SkColorPriv.h"
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after
757 fDst = dst; 757 fDst = dst;
758 fRowBytes = rowBytes; 758 fRowBytes = rowBytes;
759 fLinesDecoded = 0; 759 fLinesDecoded = 0;
760 } 760 }
761 761
762 SkCodec::Result decode(int* rowsDecoded) override { 762 SkCodec::Result decode(int* rowsDecoded) override {
763 this->processData(); 763 this->processData();
764 764
765 // Now apply Xforms on all the rows that were decoded. 765 // Now apply Xforms on all the rows that were decoded.
766 if (!fLinesDecoded) { 766 if (!fLinesDecoded) {
767 if (rowsDecoded) {
768 *rowsDecoded = 0;
769 }
767 return SkCodec::kIncompleteInput; 770 return SkCodec::kIncompleteInput;
768 } 771 }
769 const int lastRow = fLinesDecoded + fFirstRow - 1; 772 const int lastRow = fLinesDecoded + fFirstRow - 1;
770 SkASSERT(lastRow <= fLastRow); 773 SkASSERT(lastRow <= fLastRow);
771 774
772 // FIXME: For resuming interlace, we may swizzle a row that hasn't chang ed. But it 775 // FIXME: For resuming interlace, we may swizzle a row that hasn't chang ed. But it
773 // may be too tricky/expensive to handle that correctly. 776 // may be too tricky/expensive to handle that correctly.
774 png_bytep srcRow = fInterlaceBuffer.get(); 777 png_bytep srcRow = fInterlaceBuffer.get();
775 const int sampleY = this->swizzler() ? this->swizzler()->sampleY() : 1; 778 const int sampleY = this->swizzler() ? this->swizzler()->sampleY() : 1;
776 void* dst = fDst; 779 void* dst = fDst;
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
1301 SkCodec* outCodec = nullptr; 1304 SkCodec* outCodec = nullptr;
1302 if (read_header(streamDeleter.get(), chunkReader, &outCodec, nullptr, nullpt r)) { 1305 if (read_header(streamDeleter.get(), chunkReader, &outCodec, nullptr, nullpt r)) {
1303 // Codec has taken ownership of the stream. 1306 // Codec has taken ownership of the stream.
1304 SkASSERT(outCodec); 1307 SkASSERT(outCodec);
1305 streamDeleter.release(); 1308 streamDeleter.release();
1306 return outCodec; 1309 return outCodec;
1307 } 1310 }
1308 1311
1309 return nullptr; 1312 return nullptr;
1310 } 1313 }
OLDNEW
« no previous file with comments | « no previous file | tests/CodecTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698