Go to file
Mike Klein fb126fa96e rework plus blend mode
The most interesting parts of this are how plus interacts with partial
coverage.  Plus needs its clamp to happen after the lerp.
Luckily, some of its math folds away:

  d' = clamp[ d*(1-c) + (s+d)*c ] ==
       clamp[ d - dc  + sc + dc ] ==
       clamp[ d       + sc      ]

What's nice there is that coverage can be folded into the src term.
This suggests that we can re-write the plus stage to clamp internally
(and thus, be viable for 8-bit) if we always pre-scale with coverage.

We don't have a way to pre-scale with 565 coverage until now, but
it's only a step or two away from there.  We can use the alternate
formulation we derived for alpha for lerp_565, calculating the alpha
coverage from red, green, and blue coverages _and_ the values of src
and dst alpha.

While we already pre-scale srcover today for 8-bit or constant coverage,
we cannot do the same for 565.  When evaluating the expression

   d' = s + (1-a)d

we need the a term to be pre-scaled with red's coverage when calculating
dr', with blue's when calculating db', etc.  Essentially we need to
carry around a bunch of extra values, and we've got no way to do that.

So instead, we'll just carefully pre-scale plus with any coverage, and
keep post-lerping srcover when we have 565 coverage.

Change-Id: I7a7a52eec7d482e1b98bb8a01ea0a3d5e67bef65
Reviewed-on: https://skia-review.googlesource.com/38300
Commit-Queue: Mike Klein <mtklein@chromium.org>
Reviewed-by: Florin Malita <fmalita@chromium.org>
2017-08-24 18:51:57 +00:00
animations first cut at a checkbox 2009-10-21 19:41:10 +00:00
bench Threaded generation of software paths 2017-08-24 15:22:57 +00:00
bin add a Win/Clang build bot 2017-07-31 19:53:51 +00:00
debugger Add Make[backend] calls for creating GrContexts 2017-07-25 14:33:03 +00:00
dm Threaded generation of software paths 2017-08-24 15:22:57 +00:00
docs update canvas doc, primarily readpixels and writepixels 2017-08-24 18:00:33 +00:00
example Add Make[backend] calls for creating GrContexts 2017-07-25 14:33:03 +00:00
experimental Add Make[backend] calls for creating GrContexts 2017-07-25 14:33:03 +00:00
fuzz Switch SkSL to std::string 2017-08-14 21:24:55 +00:00
gm Fix artifacts on tiny stroked paths scaled up a lot. 2017-08-23 13:54:25 +00:00
gn Revert "Revert "Revert "Add GrTextureOp and use to implement SkGpuDevice::drawImage[Rect]() when possible""" 2017-08-22 21:36:40 +00:00
include Revert "Switch atlas clients over to using absolute texture coordinates" 2017-08-24 17:56:30 +00:00
infra Threaded generation of software paths 2017-08-24 15:22:57 +00:00
platform_tools Enable ios on Raspberry Pi 2017-04-25 16:56:41 +00:00
resources Move lang to list in Android font manager. 2017-08-14 19:29:05 +00:00
samplecode Replace SkFAIL with SK_ABORT. 2017-08-16 15:37:54 +00:00
site update canvas doc, primarily readpixels and writepixels 2017-08-24 18:00:33 +00:00
src rework plus blend mode 2017-08-24 18:51:57 +00:00
tests Threaded generation of software paths 2017-08-24 15:22:57 +00:00
third_party Make haveDecodedRow return void 2017-08-22 19:36:48 +00:00
tools update canvas doc, primarily readpixels and writepixels 2017-08-24 18:00:33 +00:00
.clang-format Mark flatennable macros as block beginning/ending in .clang-format 2017-01-09 15:31:36 +00:00
.gitignore clang on windows support 2017-07-31 18:39:23 +00:00
.gn Basic standalone GN configs. 2016-07-21 12:25:45 -07:00
AUTHORS Added support for building for tvOS 2017-03-14 22:55:04 +00:00
BUILD.gn Reland "skia: add heif decoding support" 2017-08-18 14:40:29 +00:00
codereview.settings Make uploading to Gerrit the default for Skia 2016-11-09 19:07:56 +00:00
CONTRIBUTING Fix references to https://sites.google.com/site/skiadocs/. 2015-02-03 13:12:54 -02:00
CQ_COMMITTERS Moved committer list to chrome-infra-auth and deleted it from the repo 2015-09-02 13:37:54 -07:00
DEPS Roll skia/third_party/externals/angle2/ 59d9da089..e080387e4 (1 commit) 2017-08-24 07:54:56 +00:00
Doxyfile Make the housekeeper upload doxygen to a newer bucket 2016-10-04 13:23:57 -07:00
LICENSE BUG=skia:5602 2016-09-02 11:19:34 -07:00
PRESUBMIT.py Update CQ extra trybots after switch to Debian 2017-06-29 19:35:40 +00:00
public.bzl remove SK_SUPPORT_LEGACY_LOCAL_ROTATE_SHADER -- see what breaks 2017-08-21 16:41:26 +00:00
README Fix references to https://sites.google.com/site/skiadocs/. 2015-02-03 13:12:54 -02:00
README.chromium Update README.chromium. 2015-06-11 13:19:24 -07:00
whitespace.txt Revert "Revert "Make GrAtlasTextOp a non-legacy GrMeshDrawOp"" 2017-07-19 12:17:34 +00:00

Skia is a complete 2D graphic library for drawing Text, Geometries, and Images.

See full details, and build instructions, at https://skia.org.