diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-04-12 19:44:38 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-04-12 19:44:38 +0000 |
commit | f3edf9fdc902465941cb763b9b4fdbfe7d004fd2 (patch) | |
tree | d8d3106744ac5dc42229ccbaad1c7b58aa696e96 /src/effects/SkDiscretePathEffect.cpp | |
parent | 1610a685e0333c62646d0ee17e4371aedaecc64d (diff) |
add SK_WARN_UNUSED_RESULT warning to SkPathMeasure methods that might leave
POD var-arguments uninitialized.
git-svn-id: http://skia.googlecode.com/svn/trunk@3665 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/effects/SkDiscretePathEffect.cpp')
-rw-r--r-- | src/effects/SkDiscretePathEffect.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/effects/SkDiscretePathEffect.cpp b/src/effects/SkDiscretePathEffect.cpp index e8c0ec9ad2..06b9d19c68 100644 --- a/src/effects/SkDiscretePathEffect.cpp +++ b/src/effects/SkDiscretePathEffect.cpp @@ -50,14 +50,17 @@ bool SkDiscretePathEffect::filterPath(SkPath* dst, const SkPath& src, n -= 1; distance += delta/2; } - meas.getPosTan(distance, &p, &v); - Perterb(&p, v, SkScalarMul(rand.nextSScalar1(), scale)); - dst->moveTo(p); + + if (meas.getPosTan(distance, &p, &v)) { + Perterb(&p, v, SkScalarMul(rand.nextSScalar1(), scale)); + dst->moveTo(p); + } while (--n >= 0) { distance += delta; - meas.getPosTan(distance, &p, &v); - Perterb(&p, v, SkScalarMul(rand.nextSScalar1(), scale)); - dst->lineTo(p); + if (meas.getPosTan(distance, &p, &v)) { + Perterb(&p, v, SkScalarMul(rand.nextSScalar1(), scale)); + dst->lineTo(p); + } } if (meas.isClosed()) { dst->close(); |