Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(343)

Side by Side Diff: include/effects/Sk1DPathEffect.h

Issue 1723483002: Revert of ix misc asserts and checks found by fuzzer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/core/SkPathEffect.h ('k') | include/effects/SkDashPathEffect.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef Sk1DPathEffect_DEFINED 8 #ifndef Sk1DPathEffect_DEFINED
9 #define Sk1DPathEffect_DEFINED 9 #define Sk1DPathEffect_DEFINED
10 10
(...skipping 27 matching lines...) Expand all
38 private: 38 private:
39 typedef SkPathEffect INHERITED; 39 typedef SkPathEffect INHERITED;
40 }; 40 };
41 41
42 class SK_API SkPath1DPathEffect : public Sk1DPathEffect { 42 class SK_API SkPath1DPathEffect : public Sk1DPathEffect {
43 public: 43 public:
44 enum Style { 44 enum Style {
45 kTranslate_Style, // translate the shape to each position 45 kTranslate_Style, // translate the shape to each position
46 kRotate_Style, // rotate the shape about its center 46 kRotate_Style, // rotate the shape about its center
47 kMorph_Style, // transform each point, and turn lines into curves 47 kMorph_Style, // transform each point, and turn lines into curves
48
49 kStyleCount
48 }; 50 };
49 51
50 /** Dash by replicating the specified path. 52 /** Dash by replicating the specified path.
51 @param path The path to replicate (dash) 53 @param path The path to replicate (dash)
52 @param advance The space between instances of path 54 @param advance The space between instances of path
53 @param phase distance (mod advance) along path for its initial position 55 @param phase distance (mod advance) along path for its initial position
54 @param style how to transform path at each point (based on the current 56 @param style how to transform path at each point (based on the current
55 position and tangent) 57 position and tangent)
56 */ 58 */
57 static SkPathEffect* Create(const SkPath& path, SkScalar advance, SkScalar p hase, Style); 59 static SkPathEffect* Create(const SkPath& path, SkScalar advance, SkScalar p hase, Style style) {
60 return new SkPath1DPathEffect(path, advance, phase, style);
61 }
58 62
59 virtual bool filterPath(SkPath*, const SkPath&, 63 virtual bool filterPath(SkPath*, const SkPath&,
60 SkStrokeRec*, const SkRect*) const override; 64 SkStrokeRec*, const SkRect*) const override;
61 65
62 SK_TO_STRING_OVERRIDE() 66 SK_TO_STRING_OVERRIDE()
63 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPath1DPathEffect) 67 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPath1DPathEffect)
64 68
65 protected: 69 protected:
66 SkPath1DPathEffect(const SkPath& path, SkScalar advance, SkScalar phase, Sty le); 70 SkPath1DPathEffect(const SkPath& path, SkScalar advance, SkScalar phase, Sty le);
67 void flatten(SkWriteBuffer&) const override; 71 void flatten(SkWriteBuffer&) const override;
68 72
69 // overrides from Sk1DPathEffect 73 // overrides from Sk1DPathEffect
70 SkScalar begin(SkScalar contourLength) const override; 74 SkScalar begin(SkScalar contourLength) const override;
71 SkScalar next(SkPath*, SkScalar, SkPathMeasure&) const override; 75 SkScalar next(SkPath*, SkScalar, SkPathMeasure&) const override;
72 76
73 private: 77 private:
74 SkPath fPath; // copied from constructor 78 SkPath fPath; // copied from constructor
75 SkScalar fAdvance; // copied from constructor 79 SkScalar fAdvance; // copied from constructor
76 SkScalar fInitialOffset; // computed from phase 80 SkScalar fInitialOffset; // computed from phase
77 Style fStyle; // copied from constructor 81 Style fStyle; // copied from constructor
78 82
79 typedef Sk1DPathEffect INHERITED; 83 typedef Sk1DPathEffect INHERITED;
80 }; 84 };
81 85
82 #endif 86 #endif
OLDNEW
« no previous file with comments | « include/core/SkPathEffect.h ('k') | include/effects/SkDashPathEffect.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698