From 411b8ea74d66d08252d9b617d7e7d458604dbc2e Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Wed, 13 Dec 2017 15:44:40 -0500 Subject: Remove SkColorSpace_Base::MakeNamed, along with most uses of Adobe RGB Bug: skia: Change-Id: If5935eac48184bc8cbe4db21dac4d6033a8704e6 Reviewed-on: https://skia-review.googlesource.com/84200 Commit-Queue: Brian Osman Reviewed-by: Mike Klein --- tests/ICCTest.cpp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'tests/ICCTest.cpp') diff --git a/tests/ICCTest.cpp b/tests/ICCTest.cpp index 4933155148..cfe4dc04a0 100644 --- a/tests/ICCTest.cpp +++ b/tests/ICCTest.cpp @@ -99,8 +99,7 @@ DEF_TEST(ICC_IsNumericalTransferFn, r) { } static inline void test_write_icc(skiatest::Reporter* r, const SkColorSpaceTransferFn& fn, - const SkMatrix44& toXYZD50, SkColorSpace* reference, - bool writeToFile) { + const SkMatrix44& toXYZD50, bool writeToFile) { sk_sp profile = SkICC::WriteToICC(fn, toXYZD50); if (writeToFile) { SkFILEWStream stream("out.icc"); @@ -108,7 +107,8 @@ static inline void test_write_icc(skiatest::Reporter* r, const SkColorSpaceTrans } sk_sp colorSpace = SkColorSpace::MakeICC(profile->data(), profile->size()); - REPORTER_ASSERT(r, SkColorSpace::Equals(reference, colorSpace.get())); + sk_sp reference = SkColorSpace::MakeRGB(fn, toXYZD50); + REPORTER_ASSERT(r, SkColorSpace::Equals(reference.get(), colorSpace.get())); } DEF_TEST(ICC_WriteICC, r) { @@ -122,8 +122,9 @@ DEF_TEST(ICC_WriteICC, r) { adobeFn.fG = 2.2f; SkMatrix44 adobeMatrix(SkMatrix44::kUninitialized_Constructor); adobeMatrix.set3x3RowMajorf(gAdobeRGB_toXYZD50); - test_write_icc(r, adobeFn, adobeMatrix, - SkColorSpace_Base::MakeNamed(SkColorSpace_Base::kAdobeRGB_Named).get(), false); + // TODO: Restore this test once we fix our Adobe matrix to be based on the decoded ICC + // fixed point values, and once we use a rounding conversion to fixed-point. +// test_write_icc(r, adobeFn, adobeMatrix, false); SkColorSpaceTransferFn srgbFn; srgbFn.fA = 1.0f / 1.055f; @@ -135,8 +136,7 @@ DEF_TEST(ICC_WriteICC, r) { srgbFn.fG = 2.4f; SkMatrix44 srgbMatrix(SkMatrix44::kUninitialized_Constructor); srgbMatrix.set3x3RowMajorf(gSRGB_toXYZD50); - test_write_icc(r, srgbFn, srgbMatrix, SkColorSpace::MakeSRGB().get(), - false); + test_write_icc(r, srgbFn, srgbMatrix, false); SkString adobeTag = SkICCGetColorProfileTag(adobeFn, adobeMatrix); SkString srgbTag = SkICCGetColorProfileTag(srgbFn, srgbMatrix); @@ -174,10 +174,6 @@ DEF_TEST(ICC_RawTransferFns, r) { sk_sp srgb = ICCTest::MakeICC(SkColorSpace::MakeSRGB()); test_raw_transfer_fn(r, srgb.get()); - sk_sp adobe = - ICCTest::MakeICC(SkColorSpace_Base::MakeNamed(SkColorSpace_Base::kAdobeRGB_Named)); - test_raw_transfer_fn(r, adobe.get()); - // Lookup-table based gamma curves constexpr size_t tableSize = 10; void* memory = sk_malloc_throw(sizeof(SkGammas) + sizeof(float) * tableSize); -- cgit v1.2.3