Index: include/codec/SkScanlineDecoder.h |
diff --git a/include/codec/SkScanlineDecoder.h b/include/codec/SkScanlineDecoder.h |
index 8376e57c09d84bb48c1d7ae295ccd441a7feab48..d8de700619bc3a31e967ea5b71df34e7e6c0c60d 100644 |
--- a/include/codec/SkScanlineDecoder.h |
+++ b/include/codec/SkScanlineDecoder.h |
@@ -75,6 +75,17 @@ public: |
return this->onReallyHasAlpha(); |
} |
+ /** |
+ * Returns whether the image is interlaced |
+ * For an interlaced image, calling getScanlines once (regardless of the count |
+ * used) needs to read the entire image, therefore it is inefficient to call |
+ * getScanlines more than once. Instead, it should only ever be called with all the |
+ * rows needed. |
+ */ |
+ bool isInterlaced() { |
+ return this->onIsInterlaced(); |
+ } |
+ |
protected: |
SkScanlineDecoder(const SkImageInfo& requested) |
: fDstInfo(requested) |
@@ -82,6 +93,13 @@ protected: |
virtual bool onReallyHasAlpha() const { return false; } |
+ /** |
+ * returns true if the image is interlaced |
+ * returns false if the image is not interlaced |
+ * only certain file types can have interlaced images, those of which override this function |
+ */ |
+ virtual bool onIsInterlaced() { return false; } |
+ |
const SkImageInfo& dstInfo() const { return fDstInfo; } |
private: |