diff options
author | Florin Malita <fmalita@chromium.org> | 2017-10-18 16:22:35 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-10-19 19:18:54 +0000 |
commit | 5f379a8b117f68b2087ab4b400b7d2f110f5600c (patch) | |
tree | edbc2cd500e55646998e3002bffe092309184896 /include/core | |
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/core')
-rw-r--r-- | include/core/SkPicture.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/core/SkPicture.h b/include/core/SkPicture.h index 290434c8ad..a5f2047e84 100644 --- a/include/core/SkPicture.h +++ b/include/core/SkPicture.h @@ -200,10 +200,11 @@ private: // V55: Drop blendmode[] from MergeImageFilter // V56: Add TileMode in SkBlurImageFilter. // V57: Sweep tiling info. + // V58: No more 2pt conical flipping. // Only SKPs within the min/current picture version range (inclusive) can be read. static const uint32_t MIN_PICTURE_VERSION = 51; // Produced by Chrome ~M56. - static const uint32_t CURRENT_PICTURE_VERSION = 57; + static const uint32_t CURRENT_PICTURE_VERSION = 58; static bool IsValidPictInfo(const SkPictInfo& info); static sk_sp<SkPicture> Forwardport(const SkPictInfo&, |