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

Unified Diff: tests/ColorSpaceTest.cpp

Issue 2409383002: Add SkColorSpaceTransferFn to SkColorSpace (Closed)
Patch Set: Add more comments 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 | « src/core/SkColorSpace_ICC.cpp ('k') | tests/ColorSpaceXformTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/ColorSpaceTest.cpp
diff --git a/tests/ColorSpaceTest.cpp b/tests/ColorSpaceTest.cpp
index a4eab92f5de78db4056e05f17f0d9d7cbcc72d45..fabeeb81f8ebb8a26e15ae6d10e900f528f02a78 100644
--- a/tests/ColorSpaceTest.cpp
+++ b/tests/ColorSpaceTest.cpp
@@ -229,6 +229,16 @@ DEF_TEST(ColorSpace_Serialize, r) {
const float gammas[] = { 1.1f, 1.2f, 1.7f, };
SkMatrix44 toXYZ(SkMatrix44::kIdentity_Constructor);
test_serialize(r, SkColorSpace_Base::NewRGB(gammas, toXYZ).get(), false);
+
+ SkColorSpaceTransferFn fn;
+ fn.fA = 1.0f;
+ fn.fB = 0.0f;
+ fn.fC = 0.0f;
+ fn.fD = 0.5f;
+ fn.fE = 1.0f;
+ fn.fF = 0.0f;
+ fn.fG = 1.0f;
+ test_serialize(r, SkColorSpace::NewRGB(fn, toXYZ).get(), false);
}
DEF_TEST(ColorSpace_Equals, r) {
@@ -250,6 +260,16 @@ DEF_TEST(ColorSpace_Equals, r) {
sk_sp<SkColorSpace> rgb2 = SkColorSpace_Base::NewRGB(gammas2, toXYZ);
sk_sp<SkColorSpace> rgb3 = SkColorSpace_Base::NewRGB(gammas1, toXYZ);
+ SkColorSpaceTransferFn fn;
+ fn.fA = 1.0f;
+ fn.fB = 0.0f;
+ fn.fC = 0.0f;
+ fn.fD = 0.5f;
+ fn.fE = 1.0f;
+ fn.fF = 0.0f;
+ fn.fG = 1.0f;
+ sk_sp<SkColorSpace> rgb4 = SkColorSpace::NewRGB(fn, toXYZ);
+
REPORTER_ASSERT(r, SkColorSpace::Equals(nullptr, nullptr));
REPORTER_ASSERT(r, SkColorSpace::Equals(srgb.get(), srgb.get()));
REPORTER_ASSERT(r, SkColorSpace::Equals(adobe.get(), adobe.get()));
@@ -259,6 +279,7 @@ DEF_TEST(ColorSpace_Equals, r) {
REPORTER_ASSERT(r, SkColorSpace::Equals(upperRight.get(), upperRight.get()));
REPORTER_ASSERT(r, SkColorSpace::Equals(rgb1.get(), rgb1.get()));
REPORTER_ASSERT(r, SkColorSpace::Equals(rgb1.get(), rgb3.get()));
+ REPORTER_ASSERT(r, SkColorSpace::Equals(rgb4.get(), rgb4.get()));
REPORTER_ASSERT(r, !SkColorSpace::Equals(nullptr, srgb.get()));
REPORTER_ASSERT(r, !SkColorSpace::Equals(srgb.get(), nullptr));
@@ -270,6 +291,7 @@ DEF_TEST(ColorSpace_Equals, r) {
REPORTER_ASSERT(r, !SkColorSpace::Equals(z30.get(), upperRight.get()));
REPORTER_ASSERT(r, !SkColorSpace::Equals(upperRight.get(), adobe.get()));
REPORTER_ASSERT(r, !SkColorSpace::Equals(rgb1.get(), rgb2.get()));
+ REPORTER_ASSERT(r, !SkColorSpace::Equals(rgb1.get(), rgb4.get()));
}
DEF_TEST(ColorSpace_Primaries, r) {
« no previous file with comments | « src/core/SkColorSpace_ICC.cpp ('k') | tests/ColorSpaceXformTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698