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

Unified Diff: ui/gfx/icc_profile_unittest.cc

Issue 2784673006: color: Do not enforce T(0)=0 and T(1)=1 constraints in approxmation (Closed)
Patch Set: Fix the right error bound Created 3 years, 9 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 | « ui/gfx/icc_profile.cc ('k') | ui/gfx/skia_color_space_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/icc_profile_unittest.cc
diff --git a/ui/gfx/icc_profile_unittest.cc b/ui/gfx/icc_profile_unittest.cc
index ebf652ee9c450b0725878c4cd9c75e090f24a1a4..ecb17139b9f10d2a3692a897bcc3a876307270fa 100644
--- a/ui/gfx/icc_profile_unittest.cc
+++ b/ui/gfx/icc_profile_unittest.cc
@@ -67,18 +67,32 @@ TEST(ICCProfile, Equality) {
TEST(ICCProfile, ParametricVersusExact) {
// This ICC profile has three transfer functions that differ enough that the
// parametric color space is considered inaccurate.
- ICCProfile inaccurate = ICCProfileForTestingNoAnalyticTrFn();
- EXPECT_NE(inaccurate.GetColorSpace(), inaccurate.GetParametricColorSpace());
+ ICCProfile multi_tr_fn = ICCProfileForTestingNoAnalyticTrFn();
+ EXPECT_NE(multi_tr_fn.GetColorSpace(), multi_tr_fn.GetParametricColorSpace());
- ICCProfile inaccurate_color_space;
+ ICCProfile multi_tr_fn_color_space;
EXPECT_TRUE(
- inaccurate.GetColorSpace().GetICCProfile(&inaccurate_color_space));
- EXPECT_EQ(inaccurate_color_space, inaccurate);
-
- ICCProfile inaccurate_parametric_color_space;
- EXPECT_TRUE(inaccurate.GetParametricColorSpace().GetICCProfile(
- &inaccurate_parametric_color_space));
- EXPECT_NE(inaccurate_parametric_color_space, inaccurate);
+ multi_tr_fn.GetColorSpace().GetICCProfile(&multi_tr_fn_color_space));
+ EXPECT_EQ(multi_tr_fn_color_space, multi_tr_fn);
+
+ ICCProfile multi_tr_fn_parametric_color_space;
+ EXPECT_TRUE(multi_tr_fn.GetParametricColorSpace().GetICCProfile(
+ &multi_tr_fn_parametric_color_space));
+ EXPECT_NE(multi_tr_fn_parametric_color_space, multi_tr_fn);
+
+ // This ICC profile has a transfer function with T(1) that is greater than 1
+ // in the approximation, but is still close enough to be considered accurate.
+ ICCProfile overshoot = ICCProfileForTestingOvershoot();
+ EXPECT_EQ(overshoot.GetColorSpace(), overshoot.GetParametricColorSpace());
+
+ ICCProfile overshoot_color_space;
+ EXPECT_TRUE(overshoot.GetColorSpace().GetICCProfile(&overshoot_color_space));
+ EXPECT_EQ(overshoot_color_space, overshoot);
+
+ ICCProfile overshoot_parametric_color_space;
+ EXPECT_TRUE(overshoot.GetParametricColorSpace().GetICCProfile(
+ &overshoot_parametric_color_space));
+ EXPECT_EQ(overshoot_parametric_color_space, overshoot);
// This ICC profile is precisely represented by the parametric color space.
ICCProfile accurate = ICCProfileForTestingAdobeRGB();
« no previous file with comments | « ui/gfx/icc_profile.cc ('k') | ui/gfx/skia_color_space_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698