aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerek Sollenberger <djsollen@google.com>2012-09-24 00:49:12 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-09-24 00:49:12 -0700
commit5a279ae580d613d8e3f2377ad047956caa4a2762 (patch)
tree7ce9fb6982c159c7039887cf4d4f3154b3dbf261
parent469152828df90903d40f5da59269ed493d69e3aa (diff)
parentfaa8dc5be4452ffc0e189e44734c075652158d7d (diff)
downloadskia-5a279ae580d613d8e3f2377ad047956caa4a2762.tar.gz
am faa8dc5b: Reduce tolerance for going into our fast path for gradients.
* commit 'faa8dc5be4452ffc0e189e44734c075652158d7d': Reduce tolerance for going into our fast path for gradients.
-rw-r--r--src/effects/SkGradientShader.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/effects/SkGradientShader.cpp b/src/effects/SkGradientShader.cpp
index 4bbc96c42f..24ed4456c8 100644
--- a/src/effects/SkGradientShader.cpp
+++ b/src/effects/SkGradientShader.cpp
@@ -1046,7 +1046,9 @@ void Linear_Gradient::shadeSpan(int x, int y, SkPMColor* SK_RESTRICT dstC,
}
LinearShadeProc shadeProc = shadeSpan_linear_repeat;
- if (SkFixedNearlyZero(dx)) {
+ // We really should check the endpoint colors, but short of that change
+ // we reduce the tolerance of SkFixedNearlyZero to be more restrictive.
+ if (SkFixedNearlyZero(dx, (SK_Fixed1 >> 14))) {
#ifdef SK_SIMPLE_TWOCOLOR_VERTICAL_GRADIENTS
if (fColorCount > 2) {
shadeProc = shadeSpan_linear_vertical_lerp;