Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(516)

Unified Diff: tests/TestConfigParsing.cpp

Issue 2389983002: Refactored SkColorSpace and added in a Lab PCS GM (Closed)
Patch Set: migrated call from SkColorSpace_Base::makeLinearGamma() to SkColorSpace_XYZ::makeLinearGamma() Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/SurfaceTest.cpp ('k') | tools/flags/SkCommonFlagsConfig.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/TestConfigParsing.cpp
diff --git a/tests/TestConfigParsing.cpp b/tests/TestConfigParsing.cpp
index 412be7362692cd1444a2eb671b4141d0078382c3..ec6d7219083027c4d8e54215c58956c06a13e109 100644
--- a/tests/TestConfigParsing.cpp
+++ b/tests/TestConfigParsing.cpp
@@ -126,22 +126,28 @@ DEF_TEST(ParseConfigs_DefaultConfigs, reporter) {
REPORTER_ASSERT(reporter, configs[25]->asConfigGpu()->getColorType() == kRGBA_F16_SkColorType);
REPORTER_ASSERT(reporter, configs[25]->asConfigGpu()->getColorSpace());
REPORTER_ASSERT(reporter, configs[25]->asConfigGpu()->getColorSpace()->gammaIsLinear());
- REPORTER_ASSERT(reporter, as_CSB(configs[25]->asConfigGpu()->getColorSpace())->toXYZD50() ==
- as_CSB(srgbColorSpace)->toXYZD50());
+ const SkMatrix44* srgbXYZ = as_CSB(srgbColorSpace)->toXYZD50();
+ SkASSERT(srgbXYZ);
+ const SkMatrix44* config25XYZ =
+ as_CSB(configs[25]->asConfigGpu()->getColorSpace())->toXYZD50();
+ SkASSERT(config25XYZ);
+ REPORTER_ASSERT(reporter, *config25XYZ == *srgbXYZ);
REPORTER_ASSERT(reporter, configs[26]->asConfigGpu()->getColorType() == kRGBA_8888_SkColorType);
REPORTER_ASSERT(reporter, configs[26]->asConfigGpu()->getColorSpace() == srgbColorSpace.get());
REPORTER_ASSERT(reporter, configs[41]->asConfigGpu()->getColorType() == kRGBA_F16_SkColorType);
REPORTER_ASSERT(reporter, configs[41]->asConfigGpu()->getColorSpace());
REPORTER_ASSERT(reporter, configs[41]->asConfigGpu()->getColorSpace()->gammaIsLinear());
- REPORTER_ASSERT(reporter, as_CSB(configs[41]->asConfigGpu()->getColorSpace())->toXYZD50() !=
- as_CSB(srgbColorSpace)->toXYZD50());
+ const SkMatrix44* config41XYZ =
+ as_CSB(configs[41]->asConfigGpu()->getColorSpace())->toXYZD50();
+ SkASSERT(config41XYZ);
+ REPORTER_ASSERT(reporter, *config41XYZ != *srgbXYZ);
+ REPORTER_ASSERT(reporter, configs[33]->asConfigGpu()->getContextType() ==
+ GrContextFactory::kGL_ContextType);
REPORTER_ASSERT(reporter, configs[42]->asConfigGpu()->getColorType() == kRGBA_F16_SkColorType);
REPORTER_ASSERT(reporter, configs[42]->asConfigGpu()->getColorSpace());
REPORTER_ASSERT(reporter, configs[42]->asConfigGpu()->getColorSpace()->gammaIsLinear());
- REPORTER_ASSERT(reporter, as_CSB(configs[42]->asConfigGpu()->getColorSpace())->toXYZD50() !=
- as_CSB(srgbColorSpace)->toXYZD50());
- REPORTER_ASSERT(reporter, configs[33]->asConfigGpu()->getContextType() ==
- GrContextFactory::kGL_ContextType);
+ REPORTER_ASSERT(reporter, *as_CSB(configs[42]->asConfigGpu()->getColorSpace())->toXYZD50() !=
+ *as_CSB(srgbColorSpace)->toXYZD50());
REPORTER_ASSERT(reporter, configs[33]->asConfigGpu()->getUseInstanced());
REPORTER_ASSERT(reporter, configs[34]->asConfigGpu()->getContextType() ==
GrContextFactory::kGL_ContextType);
« no previous file with comments | « tests/SurfaceTest.cpp ('k') | tools/flags/SkCommonFlagsConfig.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698