skia2/include
Florin Malita 5f379a8b11 Avoid 2PtConical gradient flipping
Currently, when startRadius > endRadius conical gradients are inverting their data
(start/end points and radii, colors and positions) to guarantee r0 < r1 at raster time.

But the radii ordering is only mildly interesting to the impl: it controls which of the
two quadratic solutions we select for the inside case, but doesn't fundamentally change
the algorithm.

Furthermore, for the "outside" case, inverting the order is already inconvenient and
needs to be taken into account (both CPU/GPU impls are already tracking this bit of
info).

Instead of transforming the gradient definition, we can detect the inverted case and
adjust the quadratic solution selector.

In practice this means:

  * |edge|    case - no change, the equation is linear
  * |inside|  case - select the smaller root instead of largest
  * |outside| case - [gpu-only] invert the clamp/limiting function

Change-Id: Ie3106464e39a4dd3848dc43671d973f7e1958e63
Reviewed-on: https://skia-review.googlesource.com/61660
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
2017-10-19 19:18:54 +00:00
..
android Add SK_API to APIs used by the android framework. 2017-09-21 18:14:36 +00:00
c C API: document sk_matrix_t 2017-03-21 18:04:34 +00:00
codec Move SkCodec::Origin into its own file 2017-10-18 19:08:16 +00:00
config Revert "Revert "SkUserConfig.h: remove out-of-date comment on SK_SFNTLY_SUBSETTER"" 2017-01-27 14:40:01 +00:00
core Avoid 2PtConical gradient flipping 2017-10-19 19:18:54 +00:00
effects Remove trailing whitespace. 2017-10-09 21:20:34 +00:00
encode Revert "Add an Option for orientation on JPEG encodes" 2017-10-18 18:09:47 +00:00
gpu Move clear-as-draw workaround to GrGLGpu and expose via GrContextOptions. 2017-10-18 12:55:06 +00:00
pathops Remove trailing whitespace. 2017-10-09 21:20:34 +00:00
ports removed dead code behind legacy fontmgr api flag 2017-10-11 15:18:57 +00:00
private Compute inverse gamma table at compile time. 2017-10-18 19:43:18 +00:00
svg Add a SkWStream-based SkSVGCanvas factory 2017-09-19 20:33:19 +00:00
utils Plumb more SkPaintFilterCanvas virtuals 2017-10-12 15:32:11 +00:00
views Remove trailing whitespace. 2017-10-09 21:20:34 +00:00