Commit Graph

5 Commits

Author SHA1 Message Date
mtklein
566ea9b9fc Tune linear->sRGB constants to round-trip all bytes.
I basically just ran a big 5-deep for-loop over the five constants here.
This is the first set of coefficients I found that round trips all bytes.
I suspect there are many such sets.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2162063003
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Review-Url: https://codereview.chromium.org/2162063003
2016-07-20 12:10:11 -07:00
mtklein
d1bd2082c5 Update rounding/clamping comments on sk_linear_to_srgb().
Rounding is enough.  No need for an explicit clamp if the inputs are in range.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2161223002

Review-Url: https://codereview.chromium.org/2161223002
2016-07-19 13:36:03 -07:00
mtklein
ac41bac40f Move sRGB <-> linear conversion components to their own files.
This makes them a little easier to use outside SkColorXform code.

I've added some notes about how best to use them and their eccentricities, and added a test.

Ultimately any software sRGB <-> linear conversion should funnel somehow through here.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2128893002
CQ_EXTRA_TRYBOTS=client.skia.android:Test-Android-GCC-Nexus5-CPU-NEON-Arm7-Release-Trybot;client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Committed: https://skia.googlesource.com/skia/+/45e58c8807179638980aae8503573b950b844e4c
Review-Url: https://codereview.chromium.org/2128893002
2016-07-08 06:33:16 -07:00
mtklein
e930459a18 Revert of Move sRGB <-> linear conversion components to their own files. (patchset #5 id:80001 of https://codereview.chromium.org/2128893002/ )
Reason for revert:
Monotonicity assert is failing on ARM.  (Different rsqrt() and invert() precision?)  Will investigate a bit tomorrow... might reland with the test TODO.

Original issue's description:
> Move sRGB <-> linear conversion components to their own files.
>
> This makes them a little easier to use outside SkColorXform code.
>
> I've added some notes about how best to use them and their eccentricities, and added a test.
>
> Ultimately any software sRGB <-> linear conversion should funnel somehow through here.
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2128893002
> CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot
>
> Committed: https://skia.googlesource.com/skia/+/45e58c8807179638980aae8503573b950b844e4c

TBR=reed@google.com,msarett@google.com,mtklein@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review-Url: https://codereview.chromium.org/2131793002
2016-07-07 18:34:06 -07:00
mtklein
45e58c8807 Move sRGB <-> linear conversion components to their own files.
This makes them a little easier to use outside SkColorXform code.

I've added some notes about how best to use them and their eccentricities, and added a test.

Ultimately any software sRGB <-> linear conversion should funnel somehow through here.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2128893002
CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot

Review-Url: https://codereview.chromium.org/2128893002
2016-07-07 14:47:36 -07:00