Index: tests/ColorSpaceTest.cpp |
diff --git a/tests/ColorSpaceTest.cpp b/tests/ColorSpaceTest.cpp |
index 313eed86f118a9b9632f4c514baa5e21813dc801..5fe97195dfbcece3539e02ed71d70553efec4c26 100644 |
--- a/tests/ColorSpaceTest.cpp |
+++ b/tests/ColorSpaceTest.cpp |
@@ -35,12 +35,14 @@ DEF_TEST(ColorSpaceParsePngICCProfile, r) { |
SkColorSpace* colorSpace = codec->getColorSpace(); |
REPORTER_ASSERT(r, nullptr != colorSpace); |
- // No need to use almost equal here. The color profile that we have extracted |
- // actually has a table of gammas. And our current implementation guesses 2.2f. |
- SkFloat3 gammas = colorSpace->gamma(); |
- REPORTER_ASSERT(r, 2.2f == gammas.fVec[0]); |
- REPORTER_ASSERT(r, 2.2f == gammas.fVec[1]); |
- REPORTER_ASSERT(r, 2.2f == gammas.fVec[2]); |
+ // The color profile that we have extracted has represents gamma with a lookup table. |
+ const SkGammas& gammas = colorSpace->gammas(); |
+ REPORTER_ASSERT(r, gammas.fRed.isTable()); |
+ REPORTER_ASSERT(r, gammas.fGreen.isTable()); |
+ REPORTER_ASSERT(r, gammas.fBlue.isTable()); |
+ REPORTER_ASSERT(r, 1024 == gammas.fRed.fTableSize); |
+ REPORTER_ASSERT(r, 1024 == gammas.fGreen.fTableSize); |
+ REPORTER_ASSERT(r, 1024 == gammas.fBlue.fTableSize); |
// These nine values were extracted from the color profile in isolation (before |
// we embedded it in the png). Here we check that we still extract the same values. |
@@ -75,10 +77,10 @@ DEF_TEST(ColorSpaceParseJpegICCProfile, r) { |
// It's important to use almost equal here. This profile sets gamma as |
// 563 / 256, which actually comes out to about 2.19922. |
- SkFloat3 gammas = colorSpace->gamma(); |
- REPORTER_ASSERT(r, almost_equal(2.2f, gammas.fVec[0])); |
- REPORTER_ASSERT(r, almost_equal(2.2f, gammas.fVec[1])); |
- REPORTER_ASSERT(r, almost_equal(2.2f, gammas.fVec[2])); |
+ const SkGammas& gammas = colorSpace->gammas(); |
+ REPORTER_ASSERT(r, almost_equal(2.2f, gammas.fRed.fValue)); |
+ REPORTER_ASSERT(r, almost_equal(2.2f, gammas.fGreen.fValue)); |
+ REPORTER_ASSERT(r, almost_equal(2.2f, gammas.fBlue.fValue)); |
// These nine values were extracted from the color profile. Until we know any |
// better, we'll assume these are the right values and test that we continue |