Index: include/codec/SkCodec.h |
diff --git a/include/codec/SkCodec.h b/include/codec/SkCodec.h |
index 2e47a261f3924f2b018d988af56440f4310de2d3..e462be2e7d64c494de89cc03241da7c5de4c08d9 100644 |
--- a/include/codec/SkCodec.h |
+++ b/include/codec/SkCodec.h |
@@ -168,15 +168,32 @@ protected: |
*/ |
RewindState SK_WARN_UNUSED_RESULT rewindIfNeeded(); |
- /* |
- * |
+ /** |
* Get method for the input stream |
- * |
*/ |
SkStream* stream() { |
return fStream.get(); |
} |
+ /** |
+ * If the codec has a scanline decoder, return it (no ownership change occurs) |
+ * else return NULL. |
+ * The returned decoder is valid while the codec exists and the client has not |
+ * created a new scanline decoder. |
+ */ |
+ SkScanlineDecoder* scanlineDecoder() { |
+ return fScanlineDecoder.get(); |
+ } |
+ |
+ /** |
+ * Allow the codec subclass to detach and take ownership of the scanline decoder. |
+ * This will likely be used when the scanline decoder needs to be destroyed |
+ * in the destructor of the subclass. |
+ */ |
+ SkScanlineDecoder* detachScanlineDecoder() { |
+ return fScanlineDecoder.detach(); |
+ } |
+ |
private: |
SkAutoTDelete<SkStream> fStream; |
bool fNeedsRewind; |