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

Issue 2178793002: Add a clamp stage to SkRasterPipelineBlitter. (Closed)

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

Description

Add a clamp stage to SkRasterPipelineBlitter. This clamps to [0,1] premul just before every store to memory. By making the clamp a stage itself, this design makes it easy to move the clamp around, to replace it with a debug-only assert-we're-clamped stage for certain formats, clamp in more places, programatically not clamp, etc. etc. Before this change, clamping was a little haphazard: store_srgb clamped R, G and B to [0,1], but not A, and didn't clamp the colors to A. 565 didn't clamp at all. 6 GMs draw subtly differently in sRGB, I think because we've started clamping colors to alpha to enforce premultiplication better. No changes for 565. My hope is that now no other stage need ever concern itself with clamping. So we don't double-clamp, I've added a _noclamp version of sk_linear_to_srgb() that simply asserts a clamp isn't necessary. This happens to expose the Sk4f _needs_trunc version that might be useful for power users (*cough* Matt *cough*). BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2178793002 Committed: https://skia.googlesource.com/skia/+/b5acf6e702e318b405a04d38bfdac602dc3ed773

Patch Set 1 #

Patch Set 2 : better name #

Patch Set 3 : needs_trunc #

Patch Set 4 : fix comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+47 lines, -13 lines) Patch
M src/core/SkRasterPipelineBlitter.cpp View 1 5 chunks +27 lines, -6 lines 0 comments Download
M src/core/SkSRGB.h View 1 2 3 2 chunks +20 lines, -7 lines 0 comments Download

Messages

Total messages: 18 (14 generated)
mtklein_C
4 years, 5 months ago (2016-07-23 19:36:14 UTC) #7
msarett
lgtm
4 years, 5 months ago (2016-07-25 13:12:07 UTC) #14
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/2178793002/60001
4 years, 5 months ago (2016-07-25 13:12:34 UTC) #16
commit-bot: I haz the power
4 years, 5 months ago (2016-07-25 13:13:51 UTC) #18
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as
https://skia.googlesource.com/skia/+/b5acf6e702e318b405a04d38bfdac602dc3ed773

Powered by Google App Engine
This is Rietveld 408576698