From 0a8f40cbe693274d8f63ac423e51be3e75ce5d35 Mon Sep 17 00:00:00 2001 From: reed Date: Tue, 28 Jun 2016 05:43:28 -0700 Subject: [PATCH] remove SK_SUPPORT_LEGACY_COLORPROFILETYPE dead-code BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2101983003 TBR= Review-Url: https://codereview.chromium.org/2101983003 --- include/core/SkBitmap.h | 3 --- include/core/SkImageInfo.h | 44 -------------------------------------------- src/core/SkImageInfo.cpp | 7 ------- 3 files changed, 54 deletions(-) diff --git a/include/core/SkBitmap.h b/include/core/SkBitmap.h index 8b49909..5406f94 100644 --- a/include/core/SkBitmap.h +++ b/include/core/SkBitmap.h @@ -86,9 +86,6 @@ public: SkColorType colorType() const { return fInfo.colorType(); } SkAlphaType alphaType() const { return fInfo.alphaType(); } SkColorSpace* colorSpace() const { return fInfo.colorSpace(); } -#ifdef SK_SUPPORT_LEGACY_COLORPROFILETYPE - SkColorProfileType profileType() const { return fInfo.profileType(); } -#endif /** * Return the number of bytes per pixel based on the colortype. If the colortype is diff --git a/include/core/SkImageInfo.h b/include/core/SkImageInfo.h index b45ee38..f143503 100644 --- a/include/core/SkImageInfo.h +++ b/include/core/SkImageInfo.h @@ -169,15 +169,6 @@ enum SkYUVColorSpace { /////////////////////////////////////////////////////////////////////////////// -#ifdef SK_SUPPORT_LEGACY_COLORPROFILETYPE -enum SkColorProfileType { - kLinear_SkColorProfileType, - kSRGB_SkColorProfileType, - - kLastEnum_SkColorProfileType = kSRGB_SkColorProfileType -}; -#endif - enum class SkSourceGammaTreatment { kRespect, kIgnore, @@ -238,41 +229,6 @@ public: return MakeUnknown(0, 0); } -#ifdef SK_SUPPORT_LEGACY_COLORPROFILETYPE - static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at, - SkColorProfileType pt) { - sk_sp cs = (kSRGB_SkColorProfileType == pt) ? - SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named) : nullptr; - return Make(width, height, ct, at, cs); - } - - static SkImageInfo MakeN32(int width, int height, SkAlphaType at, SkColorProfileType pt) { - sk_sp cs = (kSRGB_SkColorProfileType == pt) ? - SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named) : nullptr; - return SkImageInfo(width, height, kN32_SkColorType, at, cs); - } - - /** - * Sets colortype to the native ARGB32 type, and the alphatype to premul. - */ - static SkImageInfo MakeN32Premul(int width, int height, SkColorProfileType pt) { - sk_sp cs = (kSRGB_SkColorProfileType == pt) ? - SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named) : nullptr; - return Make(width, height, kN32_SkColorType, kPremul_SkAlphaType, cs); - } - - /** - * Sets colortype to the native ARGB32 type, and the alphatype to premul. - */ - static SkImageInfo MakeN32Premul(const SkISize& size, SkColorProfileType pt) { - return MakeN32Premul(size.width(), size.height(), pt); - } - - SkColorProfileType profileType() const; - bool isLinear() const { return kLinear_SkColorProfileType == this->profileType(); } - bool isSRGB() const { return kSRGB_SkColorProfileType == this->profileType(); } -#endif - int width() const { return fWidth; } int height() const { return fHeight; } SkColorType colorType() const { return fColorType; } diff --git a/src/core/SkImageInfo.cpp b/src/core/SkImageInfo.cpp index ba418d5..b3b9c38 100644 --- a/src/core/SkImageInfo.cpp +++ b/src/core/SkImageInfo.cpp @@ -9,13 +9,6 @@ #include "SkReadBuffer.h" #include "SkWriteBuffer.h" -#ifdef SK_SUPPORT_LEGACY_COLORPROFILETYPE -SkColorProfileType SkImageInfo::profileType() const { - return fColorSpace && fColorSpace->gammaCloseToSRGB() - ? kSRGB_SkColorProfileType : kLinear_SkColorProfileType; -} -#endif - static bool alpha_type_is_valid(SkAlphaType alphaType) { return (alphaType >= 0) && (alphaType <= kLastEnum_SkAlphaType); } -- 2.7.4