Moved named common transfer functions and gamuts to constexpr values in
SkColorSpace.h, in SkNamedTransferFn and SkNamedGamut namespaces.
Converted nearly all SkColorSpace::MakeRGB calls within Skia to use the
new factory with the named values. Multiple clients want a way to
extract named transfer function and gamut - this still doesn't provide
that, but this may be a better path forward for honestly advertising how
SkColorSpace works internally.
Originally landed as:
https://skia.googlesource.com/skia/+/a9549ab31630fc244094e6f1692371cbaf87f666
Re-landing with a new serialization format, but maintaining ability to
load old serialized color spaces, for SKP compatibility.
Bug: skia:
Change-Id: Ib84a6e1cd5d7d9816175773fdbaff2ca32658667
Reviewed-on: https://skia-review.googlesource.com/c/181176
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This reverts commit a9549ab316.
Reason for revert: SKPs changed?
Original change's description:
> Add SkColorSpace factory from 3x3 row-major gamut and transfer function
>
> Moved named common transfer functions and gamuts to constexpr values in
> SkColorSpace.h, in SkNamedTransferFn and SkNamedGamut namespaces.
>
> Converted nearly all SkColorSpace::MakeRGB calls within Skia to use the
> new factory with the named values. Multiple clients want a way to
> extract named transfer function and gamut - this still doesn't provide
> that, but this may be a better path forward for honestly advertising how
> SkColorSpace works internally.
>
> Bug: skia:
> Change-Id: I9296d67e8f0dab5ceb49869cb3ba24e98a05f3c4
> Reviewed-on: https://skia-review.googlesource.com/c/180360
> Reviewed-by: Mike Klein <mtklein@google.com>
> Reviewed-by: Brian Osman <brianosman@google.com>
> Commit-Queue: Brian Osman <brianosman@google.com>
TBR=mtklein@google.com,brianosman@google.com,reed@google.com
Change-Id: Ie888f877b3c1dba33e1a8c0f5fa92594628de7fb
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/181300
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Moved named common transfer functions and gamuts to constexpr values in
SkColorSpace.h, in SkNamedTransferFn and SkNamedGamut namespaces.
Converted nearly all SkColorSpace::MakeRGB calls within Skia to use the
new factory with the named values. Multiple clients want a way to
extract named transfer function and gamut - this still doesn't provide
that, but this may be a better path forward for honestly advertising how
SkColorSpace works internally.
Bug: skia:
Change-Id: I9296d67e8f0dab5ceb49869cb3ba24e98a05f3c4
Reviewed-on: https://skia-review.googlesource.com/c/180360
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Ignoring for the moment principled reasons to do this,
this has the following nice properties:
1) in the absence of a color space transform,
all sources are transformed to opaque by dropping
their alpha channel (not part of the steps)
2) premul sources are not unpremultiplied
unless we need to transform color spaces
3) unpremul sources are never premultiplied
This seems like the best generalization of 1) to cases
that require a color space transformation.
The alternative that we have at head treats opaque as
unpremul, so transforming from premul to opaque preserves
the abstract color but not the color composed on black.
Change-Id: Ic7d7ee24012da3d53378c20f5a4e54fa32405613
Reviewed-on: https://skia-review.googlesource.com/148388
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
All the existing calls are ported over, and new tests cover
unpremul output. (Opaque output is an impossible request.)
Change-Id: I744d640763cf74c368d3b3aba4a262c8fd9f7a01
Reviewed-on: https://skia-review.googlesource.com/147100
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Added some helper functions and put the booleans in a nested struct
(this is motivated by upcoming changes). Added a unit test of steps
against skcms, with round-tripping in both combinations.
Change-Id: Iea3d60cd52edb5259b5576b1422ed6f856cde815
Reviewed-on: https://skia-review.googlesource.com/134660
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
feels so good.
Change-Id: I24d223957945ee81f34e5815a8e9afe32ef5004e
Reviewed-on: https://skia-review.googlesource.com/131110
Commit-Queue: Mike Klein <mtklein@chromium.org>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Here's our drawing pipeline if we always blend as encoded.
I think it's very intuitive.
Change-Id: I0e531c5da1f6279d0da1f19b84d6317d99942da3
Reviewed-on: https://skia-review.googlesource.com/130131
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Change-Id: I26ed83bb613a83a0fd73f2f8b868b775be1ce968
Reviewed-on: https://skia-review.googlesource.com/130121
Commit-Queue: Mike Klein <mtklein@chromium.org>
Auto-Submit: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
Change-Id: I72e1084e6a14b3c1fa3f0a5c2100f13c6bcb24c7
Reviewed-on: https://skia-review.googlesource.com/130062
Commit-Queue: Mike Klein <mtklein@chromium.org>
Auto-Submit: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
- opaque and unpremul are never the same...
there's no reason to ever premul opaque sources.
- under optimization, they won't always be a deterministic
tweak the the premul steps (though right now they still are).
Change-Id: I5669b3dba83774326c07d5a8f16b1d2ce2b22aae
Reviewed-on: https://skia-review.googlesource.com/130061
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@chromium.org>
Change-Id: I3bb3ec19ee856ce4070a58a57b3bb8e8a170a5b9
Reviewed-on: https://skia-review.googlesource.com/130024
Commit-Queue: Mike Klein <mtklein@chromium.org>
Auto-Submit: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
Lots TODO.
Change-Id: I95edb764b85a5140d432adb506c3b537869e6df4
Reviewed-on: https://skia-review.googlesource.com/129933
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Brian Osman <brianosman@google.com>
Auto-Submit: Mike Klein <mtklein@chromium.org>