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

Unified Diff: src/codec/SkScanlineDecoder.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/SkScanlineDecoder.cpp
diff --git a/src/codec/SkScanlineDecoder.cpp b/src/codec/SkScanlineDecoder.cpp
index e011507f80c316cf445764974bb78aa18104aa47..814a869a1eeae08c0af9025fa04bd9c3b0b4d5b4 100644
--- a/src/codec/SkScanlineDecoder.cpp
+++ b/src/codec/SkScanlineDecoder.cpp
@@ -106,3 +106,20 @@ SkCodec::Result SkScanlineDecoder::start(const SkImageInfo& dstInfo) {
return this->start(dstInfo, nullptr, nullptr, nullptr);
}
+int SkScanlineDecoder::getY(int srcY) const {
+ //SkASSERT(0 < srcY && srcY < this->dstInfo().height());
scroggo 2015/09/25 15:55:06 Why is this commented out? Should it return some i
msarett 2015/10/01 12:44:52 Hmmm... Looks like I commented this out instead o
+ switch (this->getScanlineOrder()) {
+ case kTopDown_SkScanlineOrder:
+ return srcY;
+ case kBottomUp_SkScanlineOrder:
+ return this->dstInfo().height() - srcY - 1;
+ case kOutOfOrder_SkScanlineOrder:
+ return get_output_row_interlaced(srcY, this->dstInfo().height());
+ case kNone_SkScanlineOrder:
+ // When the scanline order is kNone, it is very inefficient to make
+ // more than a single call to getScanlines(), so we should never need
+ // to call getY().
+ SkASSERT(false);
+ return 0;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698