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

Unified Diff: include/codec/SkScanlineDecoder.h

Issue 1260673002: SkScaledCodec class (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove setSampleX(), move IsInterlaced() to scanlineDecoder Created 5 years, 5 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: 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:

Powered by Google App Engine
This is Rietveld 408576698