Refactored SkColorSpace and added in a Lab PCS GM
The refactoring breaks off A2B0 tag support into a separate
subclass of SkColorSpace_Base, while keeping the current
(besides CLUT) functionality in a XYZTRC subclass.
ICC profile loading is now aware of this and creates the A2B0
subclass when SkColorSpace::NewICC() is called on a profile
in need of the A2B0 functionality.
The LabPCSDemo GM loads a .icc profile containing a LAB PCS and
then runs a Lab->XYZ conversion on an image using it so we can
display it and test out the A2B0 SkColorSpace functionality,
sans a/b/m-curves, as well as the Lab->XYZ conversion code.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2389983002
Review-Url: https://codereview.chromium.org/2389983002
diff --git a/tests/SurfaceTest.cpp b/tests/SurfaceTest.cpp
index 241ddb1..180f2d9 100644
--- a/tests/SurfaceTest.cpp
+++ b/tests/SurfaceTest.cpp
@@ -921,9 +921,10 @@
auto srgbColorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named);
auto adobeColorSpace = SkColorSpace::NewNamed(SkColorSpace::kAdobeRGB_Named);
- SkMatrix44 srgbMatrix = as_CSB(srgbColorSpace)->toXYZD50();
+ const SkMatrix44* srgbMatrix = as_CSB(srgbColorSpace)->toXYZD50();
+ SkASSERT(srgbMatrix);
const float oddGamma[] = { 2.4f, 2.4f, 2.4f };
- auto oddColorSpace = SkColorSpace::NewRGB(oddGamma, srgbMatrix);
+ auto oddColorSpace = SkColorSpace::NewRGB(oddGamma, *srgbMatrix);
auto linearColorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGBLinear_Named);
const struct {