Chromium Code Reviews| Index: src/core/SkColorSpaceXform.cpp |
| diff --git a/src/core/SkColorSpaceXform.cpp b/src/core/SkColorSpaceXform.cpp |
| index f20886af7b11bd80e29e986b2df521ac41463f8e..0b17a50d2a79a4fefc79ebebffc4034bb52c9ae5 100644 |
| --- a/src/core/SkColorSpaceXform.cpp |
| +++ b/src/core/SkColorSpaceXform.cpp |
| @@ -446,13 +446,10 @@ static void build_gamma_tables(const T* outGammaTables[3], T* gammaTableStorage, |
| /////////////////////////////////////////////////////////////////////////////////////////////////// |
| -static inline bool compute_gamut_xform(SkMatrix44* srcToDst, const SkMatrix44& srcToXYZ, |
| - const SkMatrix44& dstToXYZ) { |
| - if (!dstToXYZ.invert(srcToDst)) { |
| - return false; |
| - } |
| - |
| - srcToDst->postConcat(srcToXYZ); |
| +static inline bool compute_gamut_xform(SkMatrix44* srcToDst, const SkColorSpace* src, |
|
msarett
2016/09/08 15:06:07
Thanks for integrating this change here!
Let's go
|
| + const SkColorSpace* dst) { |
| + *srcToDst = as_CSB(dst)->fromXYZ(); |
| + srcToDst->postConcat(src->toXYZ()); |
| return true; |
| } |
| @@ -482,7 +479,7 @@ std::unique_ptr<SkColorSpaceXform> SkColorSpaceXform::New(const sk_sp<SkColorSpa |
| if (SkColorSpace::Equals(srcSpace.get(), dstSpace.get())) { |
| srcToDst.setIdentity(); |
| csm = kFull_ColorSpaceMatch; |
| - } else if (!compute_gamut_xform(&srcToDst, srcSpace->xyz(), dstSpace->xyz())) { |
| + } else if (!compute_gamut_xform(&srcToDst, srcSpace.get(), dstSpace.get())) { |
| return nullptr; |
| } else if (is_almost_identity(srcToDst)) { |
| srcToDst.setIdentity(); |