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

Unified Diff: include/codec/SkCodec.h

Issue 1489163002: Add currScanline() getter to SkCodec API (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Change comments in SkCodec.h Created 5 years 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 | « no previous file | src/codec/SkCodec_libgif.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/codec/SkCodec.h
diff --git a/include/codec/SkCodec.h b/include/codec/SkCodec.h
index dffab6b3779207aeba99084810afb27d8416a097..9476d85c4ed01b178ec60dc9710c3ef03e0fda4c 100644
--- a/include/codec/SkCodec.h
+++ b/include/codec/SkCodec.h
@@ -397,9 +397,9 @@ public:
int nextScanline() const { return this->outputScanline(fCurrScanline); }
/**
- * Returns the output y-coordinate of the row that corresponds to an input
- * y-coordinate. The input y-coordinate represents where the scanline
- * is located in the encoded data.
+ * Returns the output y-coordinate of the row that corresponds to an input
+ * y-coordinate. The input y-coordinate represents where the scanline
+ * is located in the encoded data.
*
* This will equal inputScanline, except in the case of strangely
* encoded image types (bottom-up bmps, interlaced gifs).
@@ -511,14 +511,22 @@ protected:
virtual SkScanlineOrder onGetScanlineOrder() const { return kTopDown_SkScanlineOrder; }
/**
- * Update the next scanline. Used by interlaced png.
+ * Update the current scanline. Used by interlaced png.
*/
- void updateNextScanline(int newY) { fCurrScanline = newY; }
+ void updateCurrScanline(int newY) { fCurrScanline = newY; }
const SkImageInfo& dstInfo() const { return fDstInfo; }
const SkCodec::Options& options() const { return fOptions; }
+ /**
+ * Returns the number of scanlines that have been decoded so far.
+ * This is unaffected by the SkScanlineOrder.
+ *
+ * Returns -1 if we have not started a scanline decode.
+ */
+ int currScanline() const { return fCurrScanline; }
+
virtual int onOutputScanline(int inputScanline) const;
private:
« no previous file with comments | « no previous file | src/codec/SkCodec_libgif.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698