SkColorSpace API cleanup
Previously:
- Gamut could be a 4x4 matrix (overspecified), or an enum.
- Transfer function could be a struct with 7 floats, or one of two
different enums.
- We had 5 of the 6 possible factories covering those [3 x 2] options.
Recently we added a single new factory that takes the skcms 7-float
struct, and the skcms 3x3 matrix. This is the exact, minimal set of
information needed to specify an SkColorSpace.
Major clients have been moved to that factory, so the other five are
being removed. The enums are also being removed, as they are no longer
part of the API. All transfer functions and gamuts covered by the old
enums are available as constexpr values (of the skcms types) in the
header (SkNamedTransferFn and SkNamedGamut).
Bug: skia:
Change-Id: I1fbbacec6997b966dd92000ab67513e7f1a9d023
Reviewed-on: https://skia-review.googlesource.com/c/184067
Reviewed-by: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/src/images/SkImageEncoderFns.h b/src/images/SkImageEncoderFns.h
index e6f5d40..c64db2b 100644
--- a/src/images/SkImageEncoderFns.h
+++ b/src/images/SkImageEncoderFns.h
@@ -168,9 +168,11 @@
}
SkColorSpaceTransferFn fn;
- SkMatrix44 toXYZD50;
+ skcms_Matrix3x3 toXYZD50;
if (cs->isNumericalTransferFn(&fn) && cs->toXYZD50(&toXYZD50)) {
- return SkICC::WriteToICC(fn, toXYZD50);
+ SkMatrix44 m44;
+ m44.set3x3RowMajorf(&toXYZD50.vals[0][0]);
+ return SkICC::WriteToICC(fn, m44);
}
return nullptr;
}