Remove SK_IGNORE_SKIMAGE_ONREFENCODED_CHANGE.
authorBen Wagner <bungeman@google.com>
Thu, 17 May 2018 15:58:38 +0000 (11:58 -0400)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Thu, 17 May 2018 20:40:03 +0000 (20:40 +0000)
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>

include/core/SkImageGenerator.h
src/codec/SkCodecImageGenerator.cpp
src/codec/SkCodecImageGenerator.h
src/image/SkImage_Base.h
src/image/SkImage_Lazy.cpp
src/ports/SkImageGeneratorCG.cpp
src/ports/SkImageGeneratorCG.h
src/ports/SkImageGeneratorWIC.cpp
src/ports/SkImageGeneratorWIC.h

index 6a9919ce1a081b852f07c3f262d9c96c11511d76..86a07475193c6b7928396edc0eecc5dbf6372e98 100644 (file)
@@ -41,15 +41,9 @@ public:
      *  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.
@@ -180,11 +174,7 @@ protected:
 
     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; }
index 65702616a3a5afe25d0c933b64649607e0fa1112..286320c9cde4027bdbbdb8a0d2e5f499cd7f4c5b 100644 (file)
@@ -35,15 +35,9 @@ SkCodecImageGenerator::SkCodecImageGenerator(std::unique_ptr<SkCodec> codec, sk_
     , 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) {
index e608d8e717a4a4e5d581fb363a92b0c4b300c24b..2bbf118941bae212c63067010db60f8b799e481c 100644 (file)
@@ -21,11 +21,7 @@ public:
     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;
index ba89585cf4593474b3f2ddeb6fd983d4a14853c3..47df69928e96b303db52de2d7379d0c3433d40f2 100644 (file)
@@ -76,11 +76,7 @@ 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;
 
index c627f2224e79d8fb21c66aa1017ec6bc3f0e304a..82d573d70876f70cbc687ec3f552557698cf0e5b 100644 (file)
@@ -85,11 +85,7 @@ 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; }
@@ -572,17 +568,10 @@ 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 {
index c3d2f77cfe3572a3f9e46bcca0ef014fc5657a50..743b2182547ea246b98512ff652a7796c6d14be8 100644 (file)
@@ -97,15 +97,9 @@ SkImageGeneratorCG::SkImageGeneratorCG(const SkImageInfo& info, const void* imag
     , 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&) {
index 4f5a3a98b3a0c47c1e050e7ecfc0a59e301f9164..ee91c845fc3df360f2751cfd873dbe4309b69a3a 100644 (file)
@@ -27,11 +27,7 @@ public:
     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;
index 19d408096043fc555f1f611f9e9c6b5ccfc07052..9aa89733d8c118417ca4920668a563613247e85b 100644 (file)
@@ -132,15 +132,9 @@ SkImageGeneratorWIC::SkImageGeneratorWIC(const SkImageInfo& info,
     , 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&) {
index c0ace676f48f89917ceb4c89bd31aae56c4965ec..5da68f2ea7aa0d85c4068ac4734964151cc61e0a 100644 (file)
@@ -39,11 +39,7 @@ public:
     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;