diff options
-rw-r--r-- | include/core/SkColorSpace.h | 13 | ||||
-rw-r--r-- | src/core/SkColorSpace.cpp | 39 |
2 files changed, 7 insertions, 45 deletions
diff --git a/include/core/SkColorSpace.h b/include/core/SkColorSpace.h index e0ef70eeca..06adc11728 100644 --- a/include/core/SkColorSpace.h +++ b/include/core/SkColorSpace.h @@ -75,6 +75,9 @@ public: */ sk_sp<SkColorSpace> makeLinearGamma(); + /** + * DO NOT USE: Will be deleted. + */ GammaNamed gammaNamed() const { return fGammaNamed; } /** @@ -90,13 +93,11 @@ public: } /** - * To be used only by UMA code. + * Returns true if the color space gamma is linear. */ - bool gammasAreMatching() const; - bool gammasAreNamed() const; - bool gammasAreValues() const; - bool gammasAreTables() const; - bool gammasAreParams() const; + bool gammaIsLinear() const { + return kLinear_GammaNamed == fGammaNamed; + } /** * Returns nullptr on failure. Fails when we fallback to serializing ICC data and diff --git a/src/core/SkColorSpace.cpp b/src/core/SkColorSpace.cpp index 191d077223..486699ecf6 100644 --- a/src/core/SkColorSpace.cpp +++ b/src/core/SkColorSpace.cpp @@ -407,42 +407,3 @@ bool SkColorSpace::Equals(const SkColorSpace* src, const SkColorSpace* dst) { 0 == memcmp(srcData->data(), dstData->data(), srcData->size()); } } - -bool SkColorSpace::gammasAreMatching() const { - const SkGammas* gammas = as_CSB(this)->gammas(); - SkASSERT(gammas); - return gammas->fRedType == gammas->fGreenType && gammas->fGreenType == gammas->fBlueType && - gammas->fRedData == gammas->fGreenData && gammas->fGreenData == gammas->fBlueData; -} - -bool SkColorSpace::gammasAreNamed() const { - const SkGammas* gammas = as_CSB(this)->gammas(); - SkASSERT(gammas); - return gammas->fRedType == SkGammas::Type::kNamed_Type && - gammas->fGreenType == SkGammas::Type::kNamed_Type && - gammas->fBlueType == SkGammas::Type::kNamed_Type; -} - -bool SkColorSpace::gammasAreValues() const { - const SkGammas* gammas = as_CSB(this)->gammas(); - SkASSERT(gammas); - return gammas->fRedType == SkGammas::Type::kValue_Type && - gammas->fGreenType == SkGammas::Type::kValue_Type && - gammas->fBlueType == SkGammas::Type::kValue_Type; -} - -bool SkColorSpace::gammasAreTables() const { - const SkGammas* gammas = as_CSB(this)->gammas(); - SkASSERT(gammas); - return gammas->fRedType == SkGammas::Type::kTable_Type && - gammas->fGreenType == SkGammas::Type::kTable_Type && - gammas->fBlueType == SkGammas::Type::kTable_Type; -} - -bool SkColorSpace::gammasAreParams() const { - const SkGammas* gammas = as_CSB(this)->gammas(); - SkASSERT(gammas); - return gammas->fRedType == SkGammas::Type::kParam_Type && - gammas->fGreenType == SkGammas::Type::kParam_Type && - gammas->fBlueType == SkGammas::Type::kParam_Type; -} |