aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar msarett <msarett@google.com>2016-04-29 11:12:22 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-04-29 11:12:22 -0700
commita2ffa98323a17036c6df018127e3723099458a93 (patch)
tree81a4fa13a3f06311bc527b8ec070088780368221 /tests
parent7b2c6dd8c918209cb92e1338905d511c68da3eb2 (diff)
Revert of Introduce SkGammas type to represent ICC gamma curves (patchset #7 id:40002 of https://codereview.chromium.org/1928123002/ )
Reason for revert: Breaks TSAN https://build.chromium.org/p/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-TSAN/builds/6387/steps/dm/logs/stdio Original issue's description: > Introduce SkGammas type to represent ICC gamma curves > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1928123002 > > Committed: https://skia.googlesource.com/skia/+/7b2c6dd8c918209cb92e1338905d511c68da3eb2 TBR=scroggo@google.com,reed@google.com,brianosman@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review-Url: https://codereview.chromium.org/1933863002
Diffstat (limited to 'tests')
-rw-r--r--tests/ColorSpaceTest.cpp24
1 files changed, 10 insertions, 14 deletions
diff --git a/tests/ColorSpaceTest.cpp b/tests/ColorSpaceTest.cpp
index e5ecbc8346..313eed86f1 100644
--- a/tests/ColorSpaceTest.cpp
+++ b/tests/ColorSpaceTest.cpp
@@ -35,14 +35,12 @@ DEF_TEST(ColorSpaceParsePngICCProfile, r) {
SkColorSpace* colorSpace = codec->getColorSpace();
REPORTER_ASSERT(r, nullptr != colorSpace);
- // The color profile that we have extracted has represents gamma with a lookup table.
- // So we expect the gamma value to be zero.
-#ifdef SK_DEBUG
- const SkColorSpace::SkGammas& gammas = colorSpace->gammas();
- REPORTER_ASSERT(r, 0.0f == gammas.red());
- REPORTER_ASSERT(r, 0.0f == gammas.green());
- REPORTER_ASSERT(r, 0.0f == gammas.blue());
-#endif
+ // 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]);
// 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.
@@ -77,12 +75,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.
-#ifdef SK_DEBUG
- const SkColorSpace::SkGammas& gammas = colorSpace->gammas();
- REPORTER_ASSERT(r, almost_equal(2.2f, gammas.red()));
- REPORTER_ASSERT(r, almost_equal(2.2f, gammas.green()));
- REPORTER_ASSERT(r, almost_equal(2.2f, gammas.blue()));
-#endif
+ 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]));
// 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