aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2018-04-18 14:54:37 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-04-18 19:28:13 +0000
commit0d129aa78255e2a1efca31094225b607b13361e1 (patch)
tree3bc72582e826b84bdc96fbff80b7b5aa58e5945e
parent061020eab431e9bf43fe47ace659fedf367c0745 (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.cpp5
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;