All implementers have been updated, so remove the flag and old code.
Change-Id: Ie9747f37dd0ea3f1db682891bcae2496a470bc3a
Reviewed-on: https://skia-review.googlesource.com/128883
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
* If non-NULL is returned, the caller is responsible for calling
* unref() on the data when it is finished.
*/
-#if SK_IGNORE_SKIMAGE_ONREFENCODED_CHANGE
- SkData* refEncodedData() {
- return this->onRefEncodedData();
- }
-#else
sk_sp<SkData> refEncodedData() {
return this->onRefEncodedData();
}
-#endif
/**
* Return the ImageInfo associated with this generator.
SkImageGenerator(const SkImageInfo& info, uint32_t uniqueId = kNeedNewImageUniqueID);
-#if SK_IGNORE_SKIMAGE_ONREFENCODED_CHANGE
- virtual SkData* onRefEncodedData() { return nullptr; }
-#else
virtual sk_sp<SkData> onRefEncodedData() { return nullptr; }
-#endif
virtual bool onGetPixels(const SkImageInfo&, void*, size_t, const Options&) { return false; }
virtual bool onIsValid(GrContext*) const { return true; }
virtual bool onQueryYUV8(SkYUVSizeInfo*, SkYUVColorSpace*) const { return false; }
, fData(std::move(data))
{}
-#if SK_IGNORE_SKIMAGE_ONREFENCODED_CHANGE
-SkData* SkCodecImageGenerator::onRefEncodedData() {
- return SkRef(fData.get());
-}
-#else
sk_sp<SkData> SkCodecImageGenerator::onRefEncodedData() {
return fData;
}
-#endif
bool SkCodecImageGenerator::onGetPixels(const SkImageInfo& requestInfo, void* requestPixels,
size_t requestRowBytes, const Options& opts) {
static std::unique_ptr<SkImageGenerator> MakeFromEncodedCodec(sk_sp<SkData>);
protected:
-#if SK_IGNORE_SKIMAGE_ONREFENCODED_CHANGE
- SkData* onRefEncodedData() override;
-#else
sk_sp<SkData> onRefEncodedData() override;
-#endif
bool onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBytes, const Options& opts)
override;
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;
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; }
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 {
, fOrigin(origin)
{}
-#if SK_IGNORE_SKIMAGE_ONREFENCODED_CHANGE
-SkData* SkImageGeneratorCG::onRefEncodedData() {
- return SkRef(fData.get());
-}
-#else
sk_sp<SkData> SkImageGeneratorCG::onRefEncodedData() {
return fData;
}
-#endif
bool SkImageGeneratorCG::onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBytes,
const Options&) {
static std::unique_ptr<SkImageGenerator> MakeFromEncodedCG(sk_sp<SkData>);
protected:
-#if SK_IGNORE_SKIMAGE_ONREFENCODED_CHANGE
- SkData* onRefEncodedData() override;
-#else
sk_sp<SkData> onRefEncodedData() override;
-#endif
bool onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBytes, const Options&)
override;
, fData(SkRef(data))
{}
-#if SK_IGNORE_SKIMAGE_ONREFENCODED_CHANGE
-SkData* SkImageGeneratorWIC::onRefEncodedData() {
- return SkRef(fData.get());
-}
-#else
sk_sp<SkData> SkImageGeneratorWIC::onRefEncodedData() {
return fData;
}
-#endif
bool SkImageGeneratorWIC::onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBytes,
const Options&) {
static SkImageGenerator* NewFromEncodedWIC(SkData* data);
protected:
-#if SK_IGNORE_SKIMAGE_ONREFENCODED_CHANGE
- SkData* onRefEncodedData() override;
-#else
sk_sp<SkData> onRefEncodedData() override;
-#endif
bool onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBytes, const Options&)
override;