Index: include/core/SkImageInfo.h |
diff --git a/include/core/SkImageInfo.h b/include/core/SkImageInfo.h |
index b2dda3f02178f2f2e241c92a06b683ddf4a9d15e..c55edd36c2252bc38fa2ad581875e839aa8a0ef5 100644 |
--- a/include/core/SkImageInfo.h |
+++ b/include/core/SkImageInfo.h |
@@ -318,4 +318,14 @@ private: |
{} |
}; |
+/////////////////////////////////////////////////////////////////////////////// |
+ |
+static inline bool SkColorAndProfileAreGammaCorrect(SkColorType ct, SkColorProfileType pt) { |
+ return kSRGB_SkColorProfileType == pt || kRGBA_F16_SkColorType == ct; |
+} |
+ |
+static inline bool SkImageInfoIsGammaCorrect(const SkImageInfo& info) { |
+ return SkColorAndProfileAreGammaCorrect(info.colorType(), info.profileType()); |
+} |
+ |
#endif |