aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/gradients/SkLinearGradient.cpp
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2015-01-28 11:44:48 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-01-28 11:44:48 -0800
commit9d91eb313623dca16bc988bad2e8b01712e4c578 (patch)
tree6200c2c8e5dec8848bf2bb35d042212fff4fe61e /src/effects/gradients/SkLinearGradient.cpp
parent3bd12efdcf0460ce3d0babaf057a01de6ce567c4 (diff)
add more checks for computing clamp counts, remove dead code
Diffstat (limited to 'src/effects/gradients/SkLinearGradient.cpp')
-rw-r--r--src/effects/gradients/SkLinearGradient.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/effects/gradients/SkLinearGradient.cpp b/src/effects/gradients/SkLinearGradient.cpp
index b34c7964ee..c7d845a188 100644
--- a/src/effects/gradients/SkLinearGradient.cpp
+++ b/src/effects/gradients/SkLinearGradient.cpp
@@ -149,6 +149,7 @@ void shadeSpan_linear_clamp(TileProc proc, SkGradFixed dx, SkGradFixed fx,
int toggle, int count) {
SkClampRange range;
range.init(fx, dx, count, 0, SkGradientShaderBase::kCache32Count - 1);
+ range.validate(count);
if ((count = range.fCount0) > 0) {
sk_memset32_dither(dstC,
@@ -332,6 +333,7 @@ void shadeSpan16_linear_clamp(TileProc proc, SkGradFixed dx, SkGradFixed fx,
int toggle, int count) {
SkClampRange range;
range.init(fx, dx, count, 0, SkGradientShaderBase::kCache32Count - 1);
+ range.validate(count);
if ((count = range.fCount0) > 0) {
dither_memset16(dstC,