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

Side by Side Diff: ui/gfx/icc_profile_unittest.cc

Issue 2652503002: Use SkICC in gfx::ICCProfile and gfx::ColorSpace (Closed)
Patch Set: Rebase Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « ui/gfx/icc_profile.cc ('k') | ui/gfx/ipc/color/gfx_param_traits.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/logging.h" 5 #include "base/logging.h"
6 #include "testing/gtest/include/gtest/gtest.h" 6 #include "testing/gtest/include/gtest/gtest.h"
7 #include "ui/gfx/color_space.h" 7 #include "ui/gfx/color_space.h"
8 #include "ui/gfx/icc_profile.h" 8 #include "ui/gfx/icc_profile.h"
9 #include "ui/gfx/test/icc_profiles.h" 9 #include "ui/gfx/test/icc_profiles.h"
10 10
(...skipping 27 matching lines...) Expand all
38 ColorSpace color_space_from_sk_color_space = 38 ColorSpace color_space_from_sk_color_space =
39 ColorSpace::FromSkColorSpace(sk_color_space); 39 ColorSpace::FromSkColorSpace(sk_color_space);
40 EXPECT_TRUE(color_space == color_space_from_sk_color_space); 40 EXPECT_TRUE(color_space == color_space_from_sk_color_space);
41 41
42 sk_sp<SkColorSpace> sk_color_space_from_color_space = 42 sk_sp<SkColorSpace> sk_color_space_from_color_space =
43 color_space.ToSkColorSpace(); 43 color_space.ToSkColorSpace();
44 EXPECT_TRUE(SkColorSpace::Equals(sk_color_space.get(), 44 EXPECT_TRUE(SkColorSpace::Equals(sk_color_space.get(),
45 sk_color_space_from_color_space.get())); 45 sk_color_space_from_color_space.get()));
46 } 46 }
47 47
48 TEST(ICCProfile, Equality) {
49 ICCProfile spin_profile = ICCProfileForTestingColorSpin();
50 ICCProfile adobe_profile = ICCProfileForTestingAdobeRGB();
51 EXPECT_TRUE(spin_profile == spin_profile);
52 EXPECT_FALSE(spin_profile != spin_profile);
53 EXPECT_FALSE(spin_profile == adobe_profile);
54 EXPECT_TRUE(spin_profile != adobe_profile);
55
56 gfx::ColorSpace spin_space = spin_profile.GetColorSpace();
57 gfx::ColorSpace adobe_space = adobe_profile.GetColorSpace();
58 EXPECT_TRUE(spin_space == spin_space);
59 EXPECT_FALSE(spin_space != spin_space);
60 EXPECT_FALSE(spin_space == adobe_space);
61 EXPECT_TRUE(spin_space != adobe_space);
62
63 EXPECT_TRUE(spin_profile == ICCProfile::FromColorSpace(spin_space));
64 EXPECT_FALSE(spin_profile != ICCProfile::FromColorSpace(spin_space));
65 EXPECT_FALSE(spin_profile == ICCProfile::FromColorSpace(adobe_space));
66 EXPECT_TRUE(spin_profile != ICCProfile::FromColorSpace(adobe_space));
67 }
68
48 } // namespace gfx 69 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/icc_profile.cc ('k') | ui/gfx/ipc/color/gfx_param_traits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698