aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/shaders/gradients/SkGradientShaderPriv.h
diff options
context:
space:
mode:
authorGravatar Yuqian Li <liyuqian@google.com>2017-12-14 13:45:08 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-12-20 19:46:26 +0000
commit915817b940b05882d85c220d2b2dc18ef184a6b4 (patch)
tree179abe73c2f9498080f5cda0d268817a5a13218a /src/shaders/gradients/SkGradientShaderPriv.h
parente7a58321bbbe094ca0f9b03e25843f7666d5c198 (diff)
Guard the sqrt(temp) where temp < 0 in 2pt conical gradient
Although Linux and Android will return NAN, iOS and some some Win10 devices would return undefined values. This relands 82161 (with the fix mentioned above). The speedup is a little less due to the additional temp < 0 check. 4.08% faster in gradient_conicalOutZero_clamp 6.83% faster in gradient_conical_clamp_shallow_dither 9.43% faster in gradient_conicalOutZero_clamp_3color 12.66% faster in gradient_conicalOut_clamp_hicolor 16.67% faster in gradient_conicalOut_clamp_3color 17.83% faster in gradient_conicalOut_clamp and the speedup is further reduced because we break up the if with two conditions into two ifs with single condition: 7.32% faster in gradient_conical_clamp_shallow_dither 8.00% faster in gradient_conicalOut_clamp_hicolor 8.57% faster in gradient_conicalOut_clamp 8.73% faster in gradient_conicalOut_clamp_3color CQ_INCLUDE_TRYBOTS=skia.primary:Test-Android-Clang-Nexus7-GPU-Tegra3-arm-Release-All-Android,Test-Android-Clang-Nexus7-GPU-Tegra3-arm-Debug-All-Android,Test-Mac-Clang-MacMini7.1-GPU-IntelIris5100-x86_64-Debug-All-CommandBuffer Change-Id: I41fb8d97e31c577b52a200f0b883591c9bdc4d1c Reviewed-on: https://skia-review.googlesource.com/84963 Commit-Queue: Yuqian Li <liyuqian@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/shaders/gradients/SkGradientShaderPriv.h')
-rw-r--r--src/shaders/gradients/SkGradientShaderPriv.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shaders/gradients/SkGradientShaderPriv.h b/src/shaders/gradients/SkGradientShaderPriv.h
index 9d82e82ef8..28c4666d4c 100644
--- a/src/shaders/gradients/SkGradientShaderPriv.h
+++ b/src/shaders/gradients/SkGradientShaderPriv.h
@@ -255,7 +255,7 @@ protected:
GrGradientEffect(ClassID classID, const CreateArgs&, bool isOpaque);
explicit GrGradientEffect(const GrGradientEffect&); // facilitates clone() implementations
- void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const final;
+ void onGetGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
// Helper function used by derived class factories to handle color space transformation and
// modulation by input alpha.