diff options
Diffstat (limited to 'src/image')
-rw-r--r-- | src/image/SkImage_Base.h | 4 | ||||
-rw-r--r-- | src/image/SkImage_Lazy.cpp | 11 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/image/SkImage_Base.h b/src/image/SkImage_Base.h index c74a7b97e0..ba89585cf4 100644 --- a/src/image/SkImage_Base.h +++ b/src/image/SkImage_Base.h @@ -76,7 +76,11 @@ public: virtual sk_sp<SkImage> onMakeSubset(const SkIRect&) const = 0; +#if SK_IGNORE_SKIMAGE_ONREFENCODED_CHANGE virtual SkData* onRefEncoded() const { return nullptr; } +#else + virtual sk_sp<SkData> onRefEncoded() const { return nullptr; } +#endif virtual bool onAsLegacyBitmap(SkBitmap*) const; diff --git a/src/image/SkImage_Lazy.cpp b/src/image/SkImage_Lazy.cpp index 9ca9d0d782..c627f2224e 100644 --- a/src/image/SkImage_Lazy.cpp +++ b/src/image/SkImage_Lazy.cpp @@ -85,7 +85,11 @@ public: sk_sp<SkColorSpace>*, SkScalar scaleAdjust[2]) const override; #endif +#if SK_IGNORE_SKIMAGE_ONREFENCODED_CHANGE SkData* onRefEncoded() const override; +#else + sk_sp<SkData> onRefEncoded() const override; +#endif sk_sp<SkImage> onMakeSubset(const SkIRect&) const override; bool getROPixels(SkBitmap*, SkColorSpace* dstColorSpace, CachingHint) const override; bool onIsLazyGenerated() const override { return true; } @@ -568,10 +572,17 @@ bool SkImage_Lazy::onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, siz return false; } +#if SK_IGNORE_SKIMAGE_ONREFENCODED_CHANGE SkData* SkImage_Lazy::onRefEncoded() const { ScopedGenerator generator(fSharedGenerator); return generator->refEncodedData(); } +#else +sk_sp<SkData> SkImage_Lazy::onRefEncoded() const { + ScopedGenerator generator(fSharedGenerator); + return generator->refEncodedData(); +} +#endif bool SkImage_Lazy::getROPixels(SkBitmap* bitmap, SkColorSpace* dstColorSpace, CachingHint chint) const { |