diff options
author | Derek Sollenberger <djsollen@google.com> | 2012-09-24 00:49:12 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-09-24 00:49:12 -0700 |
commit | 5a279ae580d613d8e3f2377ad047956caa4a2762 (patch) | |
tree | 7ce9fb6982c159c7039887cf4d4f3154b3dbf261 | |
parent | 469152828df90903d40f5da59269ed493d69e3aa (diff) | |
parent | faa8dc5be4452ffc0e189e44734c075652158d7d (diff) | |
download | skia-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.cpp | 4 |
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; |