Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Issue 2173803002: Add clamp to sk_linear_to_srgb, reorder instructions (Closed)

Created:
4 years, 5 months ago by msarett
Modified:
4 years, 5 months ago
Reviewers:
mtklein
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Add clamp to sk_linear_to_srgb, reorder instructions Improves performance for xforms toSRGB and to2Dot2. Seems more optimal to save clamping until the end. That way we don't stall the mul pipeline with a min/max. toSRGB: 371us -> 346us to2Dot2: 404us -> 387us FWIW, it probably makes sense to clamp inside sk_linear_to_srgb anyway. If not, we should potentially provide two versions (one that clamps and one that doesn't). BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2173803002 CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot Committed: https://skia.googlesource.com/skia/+/a5ba329c81dd6e21f8d610b56416d9f45259fa42

Patch Set 1 #

Patch Set 2 : Don't bother with zero shifts, compiler does it for us #

Patch Set 3 : Add a very important set of parentheses #

Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -13 lines) Patch
M src/core/SkSRGB.h View 1 2 2 chunks +7 lines, -1 line 0 comments Download
M src/opts/SkColorXform_opts.h View 4 chunks +5 lines, -12 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 16 (12 generated)
msarett
4 years, 5 months ago (2016-07-22 12:36:15 UTC) #6
mtklein
lgtm I do think the other use cases are going to be <0 or >1, ...
4 years, 5 months ago (2016-07-22 13:05:25 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2173803002/60001
4 years, 5 months ago (2016-07-22 13:13:50 UTC) #14
commit-bot: I haz the power
4 years, 5 months ago (2016-07-22 13:23:03 UTC) #16
Message was sent while issue was closed.
Committed patchset #3 (id:60001) as
https://skia.googlesource.com/skia/+/a5ba329c81dd6e21f8d610b56416d9f45259fa42

Powered by Google App Engine
This is Rietveld 408576698