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 "include/core/SkTypes.h" 9 10 #include "include/core/SkICC.h" 11 #include "include/core/SkString.h" 12 #include "include/third_party/skcms/skcms.h" 13 #include "src/core/SkColorSpacePriv.h" 14 #include "tests/Test.h" 15 #include "tools/Resources.h" 16 DEF_TEST(AdobeRGB,r)17DEF_TEST(AdobeRGB, r) { 18 if (sk_sp<SkData> profile = GetResourceAsData("icc_profiles/AdobeRGB1998.icc")) { 19 skcms_ICCProfile parsed; 20 REPORTER_ASSERT(r, skcms_Parse(profile->data(), profile->size(), &parsed)); 21 22 auto got = SkColorSpace::Make(parsed); 23 auto want = SkColorSpace::MakeRGB(SkNamedTransferFn::k2Dot2, SkNamedGamut::kAdobeRGB); 24 REPORTER_ASSERT(r, SkColorSpace::Equals(got.get(), want.get())); 25 } 26 } 27