Index: include/codec/SkCodec.h |
diff --git a/include/codec/SkCodec.h b/include/codec/SkCodec.h |
index beb9cb97b32bdb51bed7cc4d76d24b968fe0858d..da55ea8d2044f008b79be1787c71743522c81134 100644 |
--- a/include/codec/SkCodec.h |
+++ b/include/codec/SkCodec.h |
@@ -48,6 +48,38 @@ public: |
*/ |
SkISize getScaledDimensions(float desiredScale) const; |
+ /** |
+ * Whether or not the memory passed to getPixels is zero initialized. |
+ */ |
+ enum ZeroInitialized { |
scroggo
2015/03/05 16:12:23
I decided to go with ZeroInitialized instead of Sk
|
+ /** |
+ * The memory passed to getPixels is zero initialized. The SkCodec |
+ * may take advantage of this by skipping writing zeroes. |
+ */ |
+ kYes_ZeroInitialized, |
+ /** |
+ * The memory passed to getPixels has not been initialized to zero, |
+ * so the SkCodec must write all zeroes to memory. |
+ * |
+ * This is the default. |
+ */ |
+ kNo_ZeroInitialized, |
+ }; |
+ |
+ /** |
+ * Specify whether this SkCodec should treat the memory passed to |
+ * getPixels as zero initialized. |
+ * |
+ * The default is No. |
+ */ |
+ void setZeroInitialized(ZeroInitialized zero) { fZeroInitialized = zero; } |
scroggo
2015/03/05 16:12:23
It probably makes sense to include this as part of
|
+ |
+ /** |
+ * Return whether this SkCodec considers memory passed to getPixels as |
+ * zero initialized. |
+ */ |
+ ZeroInitialized getZeroInitialized() const { return fZeroInitialized; } |
+ |
protected: |
SkCodec(const SkImageInfo&, SkStream*); |
@@ -85,8 +117,9 @@ protected: |
bool SK_WARN_UNUSED_RESULT rewindIfNeeded(); |
private: |
- const SkImageInfo fInfo; |
+ const SkImageInfo fInfo; |
SkAutoTDelete<SkStream> fStream; |
- bool fNeedsRewind; |
+ bool fNeedsRewind; |
+ ZeroInitialized fZeroInitialized; |
}; |
#endif // SkCodec_DEFINED |