diff options
author | Mike Klein <mtklein@google.com> | 2017-12-14 12:10:05 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-12-14 12:10:12 +0000 |
commit | 63789ccc03f6e63caa3e6c74fee9ad18e073cecf (patch) | |
tree | fdfdf4e8627c10eb7d579ab41140a5c2e25026b3 /tests/ICCTest.cpp | |
parent | 32af335e7abbf562dad8f1bd21bb013610b8b021 (diff) |
Revert "Remove SkColorSpace_Base::MakeNamed, along with most uses of Adobe RGB"
This reverts commit 411b8ea74d66d08252d9b617d7e7d458604dbc2e.
Reason for revert: a couple layout tests in the roll. :/
Original change's description:
> 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 <brianosman@google.com>
> Reviewed-by: Mike Klein <mtklein@chromium.org>
TBR=mtklein@chromium.org,brianosman@google.com
Change-Id: I6d2eb57b613035ec26da15218182c808bed364ed
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/84920
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Diffstat (limited to 'tests/ICCTest.cpp')
-rw-r--r-- | tests/ICCTest.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/tests/ICCTest.cpp b/tests/ICCTest.cpp index cfe4dc04a0..4933155148 100644 --- a/tests/ICCTest.cpp +++ b/tests/ICCTest.cpp @@ -99,7 +99,8 @@ DEF_TEST(ICC_IsNumericalTransferFn, r) { } static inline void test_write_icc(skiatest::Reporter* r, const SkColorSpaceTransferFn& fn, - const SkMatrix44& toXYZD50, bool writeToFile) { + const SkMatrix44& toXYZD50, SkColorSpace* reference, + bool writeToFile) { sk_sp<SkData> profile = SkICC::WriteToICC(fn, toXYZD50); if (writeToFile) { SkFILEWStream stream("out.icc"); @@ -107,8 +108,7 @@ static inline void test_write_icc(skiatest::Reporter* r, const SkColorSpaceTrans } sk_sp<SkColorSpace> colorSpace = SkColorSpace::MakeICC(profile->data(), profile->size()); - sk_sp<SkColorSpace> reference = SkColorSpace::MakeRGB(fn, toXYZD50); - REPORTER_ASSERT(r, SkColorSpace::Equals(reference.get(), colorSpace.get())); + REPORTER_ASSERT(r, SkColorSpace::Equals(reference, colorSpace.get())); } DEF_TEST(ICC_WriteICC, r) { @@ -122,9 +122,8 @@ DEF_TEST(ICC_WriteICC, r) { adobeFn.fG = 2.2f; SkMatrix44 adobeMatrix(SkMatrix44::kUninitialized_Constructor); adobeMatrix.set3x3RowMajorf(gAdobeRGB_toXYZD50); - // 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); + test_write_icc(r, adobeFn, adobeMatrix, + SkColorSpace_Base::MakeNamed(SkColorSpace_Base::kAdobeRGB_Named).get(), false); SkColorSpaceTransferFn srgbFn; srgbFn.fA = 1.0f / 1.055f; @@ -136,7 +135,8 @@ DEF_TEST(ICC_WriteICC, r) { srgbFn.fG = 2.4f; SkMatrix44 srgbMatrix(SkMatrix44::kUninitialized_Constructor); srgbMatrix.set3x3RowMajorf(gSRGB_toXYZD50); - test_write_icc(r, srgbFn, srgbMatrix, false); + test_write_icc(r, srgbFn, srgbMatrix, SkColorSpace::MakeSRGB().get(), + false); SkString adobeTag = SkICCGetColorProfileTag(adobeFn, adobeMatrix); SkString srgbTag = SkICCGetColorProfileTag(srgbFn, srgbMatrix); @@ -174,6 +174,10 @@ DEF_TEST(ICC_RawTransferFns, r) { sk_sp<SkICC> srgb = ICCTest::MakeICC(SkColorSpace::MakeSRGB()); test_raw_transfer_fn(r, srgb.get()); + sk_sp<SkICC> 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); |