aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/shaders/gradients/SkGradientShaderPriv.h
diff options
context:
space:
mode:
authorGravatar Florin Malita <fmalita@chromium.org>2017-06-28 14:46:54 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-06-28 19:15:49 +0000
commit2e409009fb715400a0d64612c57187465c12790c (patch)
treec70f520634c129ac32d1f90ff494fa587f632f27 /src/shaders/gradients/SkGradientShaderPriv.h
parentc02de0b844fdb04e28e45ed5bbdd5eb0935c42d2 (diff)
2pt conical stage for focal-pt-on-edge case
When the focal point is on the edge of the end circle, the quadratic equation devolves to linear. Add a stage to handle this case. As a complication, this case can produce "degenerate" values: 1) t == NaN 2) R(t) < 0 For these, we're supposed to draw transparent black - which means overwriting the color from the gradient stage. To support this, build a 0/1 vector mask in the context, and apply it post-gradient-stage. Change-Id: Ice4e3243abfd8c784bb810f6c310aed7a4ac7dc8 Reviewed-on: https://skia-review.googlesource.com/21111 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Klein <mtklein@google.com>
Diffstat (limited to 'src/shaders/gradients/SkGradientShaderPriv.h')
-rw-r--r--src/shaders/gradients/SkGradientShaderPriv.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/shaders/gradients/SkGradientShaderPriv.h b/src/shaders/gradients/SkGradientShaderPriv.h
index 3322982708..6e6e7df074 100644
--- a/src/shaders/gradients/SkGradientShaderPriv.h
+++ b/src/shaders/gradients/SkGradientShaderPriv.h
@@ -239,7 +239,10 @@ protected:
virtual bool adjustMatrixAndAppendStages(SkArenaAlloc* alloc,
SkMatrix* matrix,
- SkRasterPipeline* p) const { return false; }
+ SkRasterPipeline* tPipeline,
+ SkRasterPipeline* postPipeline) const {
+ return false;
+ }
template <typename T, typename... Args>
static Context* CheckedMakeContext(SkArenaAlloc* alloc, Args&&... args) {