diff options
author | 2017-10-18 16:22:35 -0400 | |
---|---|---|
committer | 2017-10-19 19:18:54 +0000 | |
commit | 5f379a8b117f68b2087ab4b400b7d2f110f5600c (patch) | |
tree | edbc2cd500e55646998e3002bffe092309184896 /include/effects/SkPaintImageFilter.h | |
parent | bc13e863e05f3984f6eecd54f4195a405d1af3fc (diff) |
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>
Diffstat (limited to 'include/effects/SkPaintImageFilter.h')
0 files changed, 0 insertions, 0 deletions