Index: src/codec/SkCodecImageGenerator.h |
diff --git a/src/codec/SkCodecImageGenerator.h b/src/codec/SkCodecImageGenerator.h |
index b12564329d78279e0a6ef25176f8e7461141bf26..22a39aaaa90e2be07036156e0b99e84f1a2edcf0 100644 |
--- a/src/codec/SkCodecImageGenerator.h |
+++ b/src/codec/SkCodecImageGenerator.h |
@@ -14,11 +14,11 @@ public: |
/* |
* If this data represents an encoded image that we know how to decode, |
* return an SkCodecImageGenerator. Otherwise return nullptr. |
- * |
- * Refs the data if an image generator can be returned. Otherwise does |
- * not affect the data. |
*/ |
- static SkImageGenerator* NewFromEncodedCodec(SkData* data); |
+ static SkImageGenerator* NewFromEncodedCodec(sk_sp<SkData>); |
+ static SkImageGenerator* NewFromEncodedCodec(SkData* data) { |
+ return NewFromEncodedCodec(sk_ref_sp(data)); |
+ } |
protected: |
SkData* onRefEncodedData(SK_REFENCODEDDATA_CTXPARAM) override; |
@@ -33,9 +33,8 @@ protected: |
private: |
/* |
* Takes ownership of codec |
- * Refs the data |
*/ |
- SkCodecImageGenerator(SkCodec* codec, SkData* data); |
+ SkCodecImageGenerator(SkCodec* codec, sk_sp<SkData>); |
SkAutoTDelete<SkCodec> fCodec; |
sk_sp<SkData> fData; |