Go to file
Florin Malita 14a8dd7255 Simplify analytical GPU gradient impls
1) reformulate the gradient data as a series of interpolation intervals,
   defined as tuples of (color_scale, color_bias) such that

       color(t) = t * color_scale + color_bias

   (this allows us to skip the relative_t computation and simply feed
    tiled_t into a fast MAD)

2) then, the existing specializations can be generalized as

   a) select an interpolation interval (possibly based on a threshold)
   b) compute the interpolated color using the method in #1

3) simplify the hard-edge cases by using clamp intervals
   (color_scale == 0) and relaxing the clamping step (allowing
   tiled_t < 0 or tiled_t > 1, in order to hit the clamping intervals
   during the selection step)

The existing specializations are converted as follows:

* kTwo_ColorType
  -> single interpolation interval, normal clamping
* kThree_ColorType
  -> two interpolation intervals, normal clamping, threshold == pos[1]
* kSingleHardStop_ColorType
  -> two interpolation intervals, normal clamping, threshold == pos[1/2]
* kHardStopLeftEdged_ColorType
  -> two interpolation intervals, clamping (-inf, 1], threshold == 0
* kHardStopRightEdged_ColorType
  -> two interpolation intervals, clamping [0, +inf), threshold == 1

This reduces the SkSL overhead in a couple of ways:

  * the clamp stage is sometimes reduced to min/max vs. full clamp()
  * the color interpolation stage is just a MAD vs. full mix()


Change-Id: I65be84d131d56136ec5e946c2b3dba149a4473cf
Reviewed-on: https://skia-review.googlesource.com/68218
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2017-11-09 15:15:54 +00:00
animations first cut at a checkbox 2009-10-21 19:41:10 +00:00
bench Add clipping options to path text bench and samples 2017-11-07 01:51:31 +00:00
bin bin/try: Add interactive mode 2017-10-18 17:16:16 +00:00
debugger Remove trailing whitespace. 2017-10-09 21:20:34 +00:00
dm add a SkFontMgr to DM that returns portable fonts 2017-11-06 21:21:42 +00:00
docs Bookmaker to work on Linux. 2017-11-08 21:07:27 +00:00
example Remove trailing whitespace. 2017-10-09 21:20:34 +00:00
experimental experimental/documentation/gerrit: authentication 2017-10-17 12:53:02 +00:00
fuzz Fuzz: use SkNullWStream 2017-08-29 17:41:36 +00:00
gm move parts of SkPoint to SkPointPriv 2017-11-08 18:25:17 +00:00
gn Don't use analytic clip FPs when drawing to stencil 2017-11-07 21:30:44 +00:00
include Prepare to enable explicit gpu resource allocation (take 2) 2017-11-08 21:00:37 +00:00
infra Switch CT_BENCH_10k_SKPs bot to use QuadroP400 2017-11-08 21:43:37 +00:00
platform_tools platform_tools/android/bin/android_gdbserver: fix error 2017-10-13 16:06:28 +00:00
resources Avoid uninitialized memory in readByteArrayAsData 2017-09-28 19:51:32 +00:00
samplecode move parts of SkPoint to SkPointPriv 2017-11-08 18:25:17 +00:00
site Bookmaker to work on Linux. 2017-11-08 21:07:27 +00:00
src Simplify analytical GPU gradient impls 2017-11-09 15:15:54 +00:00
tests move parts of SkPoint to SkPointPriv 2017-11-08 18:25:17 +00:00
third_party Revert "Add an Option for orientation on JPEG encodes" 2017-10-18 18:09:47 +00:00
tools Bookmaker to work on Linux. 2017-11-08 21:07:27 +00:00
.clang-format Mark flatennable macros as block beginning/ending in .clang-format 2017-01-09 15:31:36 +00:00
.gitignore Ignore generated README.recipes.md 2017-10-26 18:07:27 +00:00
.gn Basic standalone GN configs. 2016-07-21 12:25:45 -07:00
AUTHORS fix use of uninitialized flag in SkCodec 2017-10-09 19:17:05 +00:00
BUILD.gn add DM::FontMgr to ok 2017-11-07 13:40:08 +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/ 0e8831341..3ef06a9f8 (1 commit) 2017-11-09 14:08:34 +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 Add in test_filter to build configuration 2017-10-16 11:09:49 +00:00
public.bzl clean up cruft about --portableFonts and --resourceFonts 2017-11-06 15:09:09 +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 "Whitespace change to test Android autoroller" 2017-09-07 15:25:02 +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.