diff options
author | Derek Sollenberger <djsollen@google.com> | 2012-09-21 11:22:57 -0400 |
---|---|---|
committer | Derek Sollenberger <djsollen@google.com> | 2012-09-21 11:22:57 -0400 |
commit | faa8dc5be4452ffc0e189e44734c075652158d7d (patch) | |
tree | 7ce9fb6982c159c7039887cf4d4f3154b3dbf261 | |
parent | ebb0af8e21433525397cefdec3a8903e3da966b0 (diff) | |
download | external_skia-faa8dc5be4452ffc0e189e44734c075652158d7d.zip external_skia-faa8dc5be4452ffc0e189e44734c075652158d7d.tar.gz external_skia-faa8dc5be4452ffc0e189e44734c075652158d7d.tar.bz2 |
Reduce tolerance for going into our fast path for gradients.
bug: 6897797
Change-Id: If7bce42f5347bc78f10c55d5041389b983813c2a
-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 4bbc96c..24ed445 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; |