Index: include/codec/SkScanlineDecoder.h |
diff --git a/include/codec/SkScanlineDecoder.h b/include/codec/SkScanlineDecoder.h |
index 8376e57c09d84bb48c1d7ae295ccd441a7feab48..2ed7b8591e8299dd102e7aad6c22ee1cbf8dcecf 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 |
scroggo
2015/07/30 17:53:01
These comments should match the name of the functi
|
+ * 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. |
msarett
2015/07/30 13:55:38
I think this comment (and the one with onIsHardToS
emmaleer
2015/07/30 17:50:39
Acknowledged.
|
+ */ |
+ bool isHardToSample() { |
+ return this->onIsHardToSample(); |
+ } |
+ |
protected: |
SkScanlineDecoder(const SkImageInfo& requested) |
: fDstInfo(requested) |
@@ -82,6 +93,12 @@ protected: |
virtual bool onReallyHasAlpha() const { return false; } |
+ /** |
+ * returns true if the image type is hard to sample and must be scaled after reading, not during |
+ * An example is interlaced pngs, where the entire image must be read for each decode |
+ */ |
+ virtual bool onIsHardToSample() { return false; } |
+ |
const SkImageInfo& dstInfo() const { return fDstInfo; } |
private: |