Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Unified Diff: src/core/SkColorSpaceXform.cpp

Issue 2324843003: Fix storage of gamut transform matrices in SkColorSpace (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkColorSpace.cpp ('k') | src/core/SkColorSpace_ICC.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkColorSpaceXform.cpp
diff --git a/src/core/SkColorSpaceXform.cpp b/src/core/SkColorSpaceXform.cpp
index 136b4da6b922522c72fb6e8de955061304fa3e02..26f08cc7c439085c7ca2bb46350ca65473fef1fb 100644
--- a/src/core/SkColorSpaceXform.cpp
+++ b/src/core/SkColorSpaceXform.cpp
@@ -446,12 +446,6 @@ static void build_gamma_tables(const T* outGammaTables[3], T* gammaTableStorage,
///////////////////////////////////////////////////////////////////////////////////////////////////
-static inline void compute_gamut_xform(SkMatrix44* srcToDst, const SkColorSpace* src,
msarett 2016/09/08 21:43:48 Thanks for inlining :)
- const SkColorSpace* dst) {
- *srcToDst = as_CSB(dst)->fromXYZD50();
- srcToDst->postConcat(src->toXYZD50());
-}
-
static inline bool is_almost_identity(const SkMatrix44& srcToDst) {
for (int i = 0; i < 4; i++) {
for (int j = 0; j < 4; j++) {
@@ -479,7 +473,7 @@ std::unique_ptr<SkColorSpaceXform> SkColorSpaceXform::New(const sk_sp<SkColorSpa
srcToDst.setIdentity();
csm = kFull_ColorSpaceMatch;
} else {
- compute_gamut_xform(&srcToDst, srcSpace.get(), dstSpace.get());
+ srcToDst.setConcat(as_CSB(dstSpace)->fromXYZD50(), srcSpace->toXYZD50());
if (is_almost_identity(srcToDst)) {
srcToDst.setIdentity();
@@ -1102,7 +1096,7 @@ SkColorSpaceXform_Base<kDst, kCSM>::SkColorSpaceXform_Base(const sk_sp<SkColorSp
const sk_sp<SkColorSpace>& dstSpace)
: fColorLUT(sk_ref_sp((SkColorLookUpTable*) as_CSB(srcSpace)->colorLUT()))
{
- srcToDst.asRowMajorf(fSrcToDst);
+ srcToDst.asColMajorf(fSrcToDst);
build_gamma_tables(fSrcGammaTables, fSrcGammaTableStorage, 256, srcSpace, kToLinear);
build_gamma_tables(fDstGammaTables, fDstGammaTableStorage, kDstGammaTableSize, dstSpace,
kFromLinear);
« no previous file with comments | « src/core/SkColorSpace.cpp ('k') | src/core/SkColorSpace_ICC.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698