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 
8 #include "SkTypes.h"
9 
10 #include "Resources.h"
11 #include "SkColorSpacePriv.h"
12 #include "SkICC.h"
13 #include "SkString.h"
14 #include "Test.h"
15 
16 #include "../third_party/skcms/skcms.h"
17 
DEF_TEST(AdobeRGB,r)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));
22 
23         auto got  = SkColorSpace::Make(parsed);
24         auto want = SkColorSpace::MakeRGB(SkNamedTransferFn::k2Dot2, SkNamedGamut::kAdobeRGB);
25         REPORTER_ASSERT(r, SkColorSpace::Equals(got.get(), want.get()));
26     }
27 }
28