diff options
author | reed <reed@google.com> | 2016-02-20 14:18:27 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-20 14:18:27 -0800 |
commit | 00bea4ad310c4ec4dd95809b47ce3fbfa8fd0e1e (patch) | |
tree | 8c7e11efbc4c108252a219c763010d5035b10846 /include/effects | |
parent | f5d4746ad73ef5eabc927d3d988bb9ee97c77921 (diff) |
fix misc asserts and checks found by fuzzer
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1713383002
TBR=robertphilips
Review URL: https://codereview.chromium.org/1713383002
Diffstat (limited to 'include/effects')
-rw-r--r-- | include/effects/Sk1DPathEffect.h | 6 | ||||
-rw-r--r-- | include/effects/SkDashPathEffect.h | 7 |
2 files changed, 4 insertions, 9 deletions
diff --git a/include/effects/Sk1DPathEffect.h b/include/effects/Sk1DPathEffect.h index 3419dc23b7..c8328881a0 100644 --- a/include/effects/Sk1DPathEffect.h +++ b/include/effects/Sk1DPathEffect.h @@ -45,8 +45,6 @@ public: kTranslate_Style, // translate the shape to each position kRotate_Style, // rotate the shape about its center kMorph_Style, // transform each point, and turn lines into curves - - kStyleCount }; /** Dash by replicating the specified path. @@ -56,9 +54,7 @@ public: @param style how to transform path at each point (based on the current position and tangent) */ - static SkPathEffect* Create(const SkPath& path, SkScalar advance, SkScalar phase, Style style) { - return new SkPath1DPathEffect(path, advance, phase, style); - } + static SkPathEffect* Create(const SkPath& path, SkScalar advance, SkScalar phase, Style); virtual bool filterPath(SkPath*, const SkPath&, SkStrokeRec*, const SkRect*) const override; diff --git a/include/effects/SkDashPathEffect.h b/include/effects/SkDashPathEffect.h index 3c1407b725..08b0a4693f 100644 --- a/include/effects/SkDashPathEffect.h +++ b/include/effects/SkDashPathEffect.h @@ -36,10 +36,7 @@ public: Note: only affects stroked paths. */ - static SkPathEffect* Create(const SkScalar intervals[], int count, SkScalar phase) { - return new SkDashPathEffect(intervals, count, phase); - } - virtual ~SkDashPathEffect(); + static SkPathEffect* Create(const SkScalar intervals[], int count, SkScalar phase); virtual bool filterPath(SkPath* dst, const SkPath& src, SkStrokeRec*, const SkRect*) const override; @@ -58,6 +55,7 @@ public: #endif protected: + virtual ~SkDashPathEffect(); SkDashPathEffect(const SkScalar intervals[], int count, SkScalar phase); void flatten(SkWriteBuffer&) const override; @@ -66,6 +64,7 @@ private: int32_t fCount; SkScalar fPhase; // computed from phase + SkScalar fInitialDashLength; int32_t fInitialDashIndex; SkScalar fIntervalLength; |