Ravi Mistry | 113d05f | 2016-12-17 01:31:03 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
Mike Klein | 5b58b7c | 2018-05-22 13:47:52 +0000 | [diff] [blame] | 8 | #include "SkTypes.h" |
Ravi Mistry | 113d05f | 2016-12-17 01:31:03 +0000 | [diff] [blame] | 9 | |
Brian Osman | 8dc68c6 | 2018-05-30 12:57:45 -0400 | [diff] [blame] | 10 | #include "Resources.h" |
| 11 | #include "SkColorSpacePriv.h" |
| 12 | #include "SkICC.h" |
| 13 | #include "SkString.h" |
| 14 | #include "Test.h" |
Hal Canary | 8a00144 | 2018-09-19 11:31:27 -0400 | [diff] [blame] | 15 | |
Brian Osman | 8dc68c6 | 2018-05-30 12:57:45 -0400 | [diff] [blame] | 16 | #include "../third_party/skcms/skcms.h" |
Ravi Mistry | 113d05f | 2016-12-17 01:31:03 +0000 | [diff] [blame] | 17 | |
Brian Osman | 8dc68c6 | 2018-05-30 12:57:45 -0400 | [diff] [blame] | 18 | DEF_TEST(AdobeRGB, r) { |
| 19 | if (sk_sp<SkData> profile = GetResourceAsData("icc_profiles/AdobeRGB1998.icc")) { |
| 20 | skcms_ICCProfile parsed; |
| 21 | REPORTER_ASSERT(r, skcms_Parse(profile->data(), profile->size(), &parsed)); |
Ravi Mistry | 113d05f | 2016-12-17 01:31:03 +0000 | [diff] [blame] | 22 | |
Brian Osman | 8dc68c6 | 2018-05-30 12:57:45 -0400 | [diff] [blame] | 23 | auto got = SkColorSpace::Make(parsed); |
Brian Osman | 82ebe04 | 2019-01-04 17:03:00 -0500 | [diff] [blame] | 24 | auto want = SkColorSpace::MakeRGB(SkNamedTransferFn::k2Dot2, SkNamedGamut::kAdobeRGB); |
Brian Osman | 8dc68c6 | 2018-05-30 12:57:45 -0400 | [diff] [blame] | 25 | REPORTER_ASSERT(r, SkColorSpace::Equals(got.get(), want.get())); |
Matt Sarett | 1bfcf88 | 2016-12-19 18:37:34 -0500 | [diff] [blame] | 26 | } |
Brian Osman | 8dc68c6 | 2018-05-30 12:57:45 -0400 | [diff] [blame] | 27 | } |