b5acf6e702
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 Review-Url: https://codereview.chromium.org/2178793002 |
||
---|---|---|
animations | ||
bench | ||
bin | ||
build_overrides | ||
cmake | ||
debugger | ||
dm | ||
example | ||
experimental | ||
fuzz | ||
gm | ||
gn | ||
gyp | ||
include | ||
infra | ||
platform_tools | ||
resources | ||
samplecode | ||
site | ||
src | ||
tests | ||
third_party | ||
tools | ||
.gitignore | ||
.gn | ||
AUTHORS | ||
BUILD.gn | ||
codereview.settings | ||
CONTRIBUTING | ||
CQ_COMMITTERS | ||
DEPS | ||
Doxyfile | ||
gyp_skia | ||
gyp_skia.py | ||
LICENSE | ||
make.bat | ||
make.py | ||
Makefile | ||
OWNERS | ||
PRESUBMIT.py | ||
public.bzl | ||
README | ||
README.chromium | ||
skia.gyp | ||
whitespace.txt |
Skia is a complete 2D graphic library for drawing Text, Geometries, and Images. See full details, and build instructions, at https://skia.org.