diff options
author | Brian Osman <brianosman@google.com> | 2018-04-18 14:54:37 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-04-18 19:28:13 +0000 |
commit | 0d129aa78255e2a1efca31094225b607b13361e1 (patch) | |
tree | 3bc72582e826b84bdc96fbff80b7b5aa58e5945e | |
parent | 061020eab431e9bf43fe47ace659fedf367c0745 (diff) |
Support all destination profiles in SkColorSpaceXform_skcms
EnsureUsable forces the profile to something that we can target, so
there may be some quality tradeoff (or complete fallback to sRGB for B2A
profiles), but we will no longer fail to transform.
Bug: skia:
Change-Id: I6c5ffb8f092cd0aeffadc361c3ae95825916fa4f
Reviewed-on: https://skia-review.googlesource.com/122080
Commit-Queue: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
-rw-r--r-- | src/core/SkColorSpaceXform_skcms.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/SkColorSpaceXform_skcms.cpp b/src/core/SkColorSpaceXform_skcms.cpp index 052b95bf3a..657bf49f24 100644 --- a/src/core/SkColorSpaceXform_skcms.cpp +++ b/src/core/SkColorSpaceXform_skcms.cpp @@ -17,8 +17,9 @@ public: skcms_AlphaFormat premulFormat) : fSrcProfile(srcProfile) , fDstProfile(dstProfile) - , fPremulFormat(premulFormat) - {} + , fPremulFormat(premulFormat) { + skcms_EnsureUsableAsDestination(&fDstProfile, &skcms_sRGB_profile); + } bool apply(ColorFormat, void*, ColorFormat, const void*, int, SkAlphaType) const override; |