Revert "Revert "WIP: Skia support library for ICC tasks""
This reverts commit eb733fbf56538838a36814c75cd03f917462cb22.
Reason for revert: Revert patch was automatically merged incorrectly?
Original change's description:
> Revert "WIP: Skia support library for ICC tasks"
>
> This reverts commit fc8dc3194acb959ee5980b41766660ca0644bcab.
>
> Reason for revert: Breaks Build-Mac-Clang-Arm7-{Debug,Release}-iOS builds.
> Example tasks:
> * https://chromium-swarm.appspot.com/task?id=3322f668620b9e10&refresh=10
> * https://chromium-swarm.appspot.com/task?id=332296146331e810&refresh=10
>
> Original change's description:
> > WIP: Skia support library for ICC tasks
> >
> > As a starting point, this would be mostly trivial to implement using
> > SkColorSpace.
> >
> > This also would give us the flexibility to begin to move all of
> > the ICC related code from SkColorSpace to SkICC.
> >
> > What are the advantages of moving this away from SkColorSpace?
> > (1) A long term goal (once Chrome uses SkCodec), might be to
> > move SkColorSpace::MakeICC() out of the public API. That way,
> > we can guarantee that we can draw to/from *any* SkColorSpace.
> > (2) Keeps SkColorSpace separate from ICC-specific representations
> > like SkColorSpaceTransferFn etc.
> >
> > BUG=skia:
> >
> > Change-Id: Iddeb9903221fb57fbfc01218d8641c928b4a5165
> > Reviewed-on: https://skia-review.googlesource.com/5676
> > Commit-Queue: Matt Sarett <msarett@google.com>
> > Reviewed-by: Brian Osman <brianosman@google.com>
> > Reviewed-by: Mike Reed <reed@google.com>
> >
>
> TBR=mtklein@google.com,msarett@google.com,brianosman@google.com,reed@google.com,reviews@skia.org
> BUG=skia:
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
>
> Change-Id: Ibdf272fce25892402bd3e85595fb8814cdf59856
> Reviewed-on: https://skia-review.googlesource.com/6232
> Commit-Queue: Ravi Mistry <rmistry@google.com>
> Reviewed-by: Ravi Mistry <rmistry@google.com>
>
TBR=mtklein@google.com,rmistry@google.com,msarett@google.com,reviews@skia.org,brianosman@google.com,reed@google.com
BUG=skia:
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Change-Id: I68b1624cfab8adfe31b17e1193a7766507dec8b0
Reviewed-on: https://skia-review.googlesource.com/6233
Commit-Queue: Ravi Mistry <rmistry@google.com>
Reviewed-by: Ravi Mistry <rmistry@google.com>
2016-12-17 01:31:03 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2016 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
2019-04-23 17:05:21 +00:00
|
|
|
#include "include/core/SkTypes.h"
|
2018-05-22 13:47:52 +00:00
|
|
|
|
2019-04-23 17:05:21 +00:00
|
|
|
#include "include/core/SkICC.h"
|
|
|
|
#include "include/core/SkString.h"
|
2019-04-29 14:28:22 +00:00
|
|
|
#include "include/third_party/skcms/skcms.h"
|
2019-04-23 17:05:21 +00:00
|
|
|
#include "src/core/SkColorSpacePriv.h"
|
|
|
|
#include "tests/Test.h"
|
|
|
|
#include "tools/Resources.h"
|
2018-09-19 15:31:27 +00:00
|
|
|
|
2018-05-30 16:57:45 +00:00
|
|
|
DEF_TEST(AdobeRGB, r) {
|
|
|
|
if (sk_sp<SkData> profile = GetResourceAsData("icc_profiles/AdobeRGB1998.icc")) {
|
|
|
|
skcms_ICCProfile parsed;
|
|
|
|
REPORTER_ASSERT(r, skcms_Parse(profile->data(), profile->size(), &parsed));
|
2018-05-10 21:08:33 +00:00
|
|
|
|
2018-05-30 16:57:45 +00:00
|
|
|
auto got = SkColorSpace::Make(parsed);
|
2019-01-04 22:03:00 +00:00
|
|
|
auto want = SkColorSpace::MakeRGB(SkNamedTransferFn::k2Dot2, SkNamedGamut::kAdobeRGB);
|
2018-05-30 16:57:45 +00:00
|
|
|
REPORTER_ASSERT(r, SkColorSpace::Equals(got.get(), want.get()));
|
2018-05-10 21:08:33 +00:00
|
|
|
}
|
2018-05-30 16:57:45 +00:00
|
|
|
}
|