From d1290843c364dda7691817f3bb52aadee8391acf Mon Sep 17 00:00:00 2001 From: reed Date: Tue, 5 May 2015 11:36:02 -0700 Subject: [PATCH] remove dead code behind BOOL_ONGETINFO need this to land in chrome first https://codereview.chromium.org/1125573002 BUG=skia: TBR= Review URL: https://codereview.chromium.org/1123473004 --- include/codec/SkCodec.h | 19 ------------------- include/core/SkImageGenerator.h | 14 -------------- src/codec/SkCodec.cpp | 3 --- src/core/SkImageGenerator.cpp | 19 ------------------- src/images/SkDecodingImageGenerator.cpp | 6 ------ src/ports/SkImageGenerator_skia.cpp | 7 ------- tests/CachedDecodingPixelRefTest.cpp | 8 -------- tests/DrawBitmapRectTest.cpp | 6 ------ 8 files changed, 82 deletions(-) diff --git a/include/codec/SkCodec.h b/include/codec/SkCodec.h index b3898892b0..2e47a261f3 100644 --- a/include/codec/SkCodec.h +++ b/include/codec/SkCodec.h @@ -111,25 +111,9 @@ public: protected: SkCodec(const SkImageInfo&, SkStream*); - /** - * The SkAlphaType is a conservative answer. i.e. it is possible that it - * initially returns a non-opaque answer, but completing the decode - * reveals that the image is actually opaque. - */ -#ifdef SK_SUPPORT_LEGACY_BOOL_ONGETINFO - bool onGetInfo(SkImageInfo* info) override { - *info = fInfo; - return true; - } -#endif - virtual SkISize onGetScaledDimensions(float /* desiredScale */) const { // By default, scaling is not supported. -#ifdef SK_SUPPORT_LEGACY_BOOL_ONGETINFO - return fInfo.dimensions(); -#else return this->getInfo().dimensions(); -#endif } virtual SkEncodedFormat onGetEncodedFormat() const = 0; @@ -194,9 +178,6 @@ protected: } private: -#ifdef SK_SUPPORT_LEGACY_BOOL_ONGETINFO - const SkImageInfo fInfo; -#endif // SK_SUPPORT_LEGACY_BOOL_ONGETINFO SkAutoTDelete fStream; bool fNeedsRewind; SkAutoTDelete fScanlineDecoder; diff --git a/include/core/SkImageGenerator.h b/include/core/SkImageGenerator.h index 5f8f5ba8fb..9760205c64 100644 --- a/include/core/SkImageGenerator.h +++ b/include/core/SkImageGenerator.h @@ -67,17 +67,7 @@ public: /** * Return the ImageInfo associated with this generator. */ -#ifdef SK_SUPPORT_LEGACY_BOOL_ONGETINFO - SkImageInfo getInfo(); - bool getInfo(SkImageInfo* info) { - if (info) { - *info = this->getInfo(); - } - return true; - } -#else const SkImageInfo& getInfo() const { return fInfo; } -#endif /** * Used to describe the result of a call to getPixels(). @@ -210,10 +200,6 @@ public: static SkImageGenerator* NewFromData(SkData*); protected: -#ifdef SK_SUPPORT_LEGACY_BOOL_ONGETINFO - SkImageGenerator() : fInfo(SkImageInfo::MakeUnknown(0, 0) ) {} - virtual bool onGetInfo(SkImageInfo* info); -#endif SkImageGenerator(const SkImageInfo& info) : fInfo(info) {} virtual SkData* onRefEncodedData(); diff --git a/src/codec/SkCodec.cpp b/src/codec/SkCodec.cpp index 85f2414ecb..c4adf729e4 100644 --- a/src/codec/SkCodec.cpp +++ b/src/codec/SkCodec.cpp @@ -71,9 +71,6 @@ SkCodec* SkCodec::NewFromData(SkData* data) { SkCodec::SkCodec(const SkImageInfo& info, SkStream* stream) : INHERITED(info) -#ifdef SK_SUPPORT_LEGACY_BOOL_ONGETINFO - , fInfo(info) -#endif , fStream(stream) , fNeedsRewind(false) {} diff --git a/src/core/SkImageGenerator.cpp b/src/core/SkImageGenerator.cpp index 08c133d925..f18dce2d2f 100644 --- a/src/core/SkImageGenerator.cpp +++ b/src/core/SkImageGenerator.cpp @@ -7,16 +7,6 @@ #include "SkImageGenerator.h" -#ifdef SK_SUPPORT_LEGACY_BOOL_ONGETINFO -SkImageInfo SkImageGenerator::getInfo() { - SkImageInfo info; - if (!this->onGetInfo(&info)) { - info = SkImageInfo::MakeUnknown(0, 0); - } - return info; -} -#endif - SkImageGenerator::Result SkImageGenerator::getPixels(const SkImageInfo& info, void* pixels, size_t rowBytes, const Options* options, SkPMColor ctable[], int* ctableCount) { @@ -122,15 +112,6 @@ SkData* SkImageGenerator::onRefEncodedData() { return NULL; } -#ifdef SK_SUPPORT_LEGACY_BOOL_ONGETINFO -bool SkImageGenerator::onGetInfo(SkImageInfo* info) { - if (info) { - *info = fInfo; - } - return true; -} -#endif - #ifdef SK_SUPPORT_LEGACY_OPTIONLESS_GET_PIXELS SkImageGenerator::Result SkImageGenerator::onGetPixels(const SkImageInfo&, void*, size_t, SkPMColor*, int*) { diff --git a/src/images/SkDecodingImageGenerator.cpp b/src/images/SkDecodingImageGenerator.cpp index 78027f42e2..2a07308447 100644 --- a/src/images/SkDecodingImageGenerator.cpp +++ b/src/images/SkDecodingImageGenerator.cpp @@ -38,12 +38,6 @@ public: protected: SkData* onRefEncodedData() override; -#ifdef SK_SUPPORT_LEGACY_BOOL_ONGETINFO - bool onGetInfo(SkImageInfo* info) override { - *info = fInfo; - return true; - } -#endif Result onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBytes, const Options&, SkPMColor ctable[], int* ctableCount) override; diff --git a/src/ports/SkImageGenerator_skia.cpp b/src/ports/SkImageGenerator_skia.cpp index 3c2ce09281..1784cc228b 100644 --- a/src/ports/SkImageGenerator_skia.cpp +++ b/src/ports/SkImageGenerator_skia.cpp @@ -47,13 +47,6 @@ protected: return SkRef(fData.get()); } -#ifdef SK_SUPPORT_LEGACY_BOOL_ONGETINFO - virtual bool onGetInfo(SkImageInfo* info) override { - *info = fInfo; - return true; - } -#endif - virtual Result onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBytes, const Options&, SkPMColor ctableEntries[], int* ctableCount) override { diff --git a/tests/CachedDecodingPixelRefTest.cpp b/tests/CachedDecodingPixelRefTest.cpp index fc56edd823..670d849436 100644 --- a/tests/CachedDecodingPixelRefTest.cpp +++ b/tests/CachedDecodingPixelRefTest.cpp @@ -182,14 +182,6 @@ protected: kOpaque_SkAlphaType); } -#ifdef SK_SUPPORT_LEGACY_BOOL_ONGETINFO - bool onGetInfo(SkImageInfo* info) override { - REPORTER_ASSERT(fReporter, info); - *info = GetMyInfo(); - return true; - } -#endif - virtual Result onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBytes, const Options&, SkPMColor ctable[], int* ctableCount) override { diff --git a/tests/DrawBitmapRectTest.cpp b/tests/DrawBitmapRectTest.cpp index 060e08b3a7..9c522db28e 100644 --- a/tests/DrawBitmapRectTest.cpp +++ b/tests/DrawBitmapRectTest.cpp @@ -22,12 +22,6 @@ class FailureImageGenerator : public SkImageGenerator { public: FailureImageGenerator() : SkImageGenerator(SkImageInfo::MakeN32Premul(100, 100)) {} protected: -#ifdef SK_SUPPORT_LEGACY_BOOL_ONGETINFO - bool onGetInfo(SkImageInfo* info) override { - *info = SkImageInfo::MakeN32Premul(100, 100); - return true; - } -#endif // default onGetPixels() returns kUnimplemented, which is what we want. };