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

Unified Diff: ui/gfx/icc_profile_unittest.cc

Issue 2873203003: color: Add --force-color-profile command line flag (Closed)
Patch Set: Created 3 years, 7 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_mac.mm ('k') | ui/gfx/icc_profile_win.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 ecb17139b9f10d2a3692a897bcc3a876307270fa..081e6de84266a9b51622206b7217bb44c92142e3 100644
--- a/ui/gfx/icc_profile_unittest.cc
+++ b/ui/gfx/icc_profile_unittest.cc
@@ -2,10 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "ui/gfx/icc_profile.h"
#include "base/logging.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/color_space.h"
-#include "ui/gfx/icc_profile.h"
+#include "ui/gfx/skia_color_space_util.h"
#include "ui/gfx/test/icc_profiles.h"
namespace gfx {
@@ -131,4 +132,21 @@ TEST(ICCProfile, GarbageData) {
EXPECT_FALSE(default_ctor_profile.GetParametricColorSpace().IsValid());
}
+TEST(ICCProfile, GenericRGB) {
+ ColorSpace icc_profile = ICCProfileForTestingGenericRGB().GetColorSpace();
+ ColorSpace color_space(ColorSpace::PrimaryID::SMPTE240M,
+ ColorSpace::TransferID::GAMMA18);
+
+ SkMatrix44 icc_profile_matrix;
+ SkMatrix44 color_space_matrix;
+
+ icc_profile.GetPrimaryMatrix(&icc_profile_matrix);
+ color_space.GetPrimaryMatrix(&color_space_matrix);
+
+ SkMatrix44 eye;
+ icc_profile_matrix.invert(&eye);
+ eye.postConcat(color_space_matrix);
+ EXPECT_TRUE(SkMatrixIsApproximatelyIdentity(eye));
+}
+
} // namespace gfx
« no previous file with comments | « ui/gfx/icc_profile_mac.mm ('k') | ui/gfx/icc_profile_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698