OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #ifndef SkPathEffect_DEFINED | 10 #ifndef SkPathEffect_DEFINED |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 * Does applying this path effect to 'src' yield a set of points? If so, | 102 * Does applying this path effect to 'src' yield a set of points? If so, |
103 * optionally return the points in 'results'. | 103 * optionally return the points in 'results'. |
104 */ | 104 */ |
105 virtual bool asPoints(PointData* results, const SkPath& src, | 105 virtual bool asPoints(PointData* results, const SkPath& src, |
106 const SkStrokeRec&, const SkMatrix&, | 106 const SkStrokeRec&, const SkMatrix&, |
107 const SkRect* cullR) const; | 107 const SkRect* cullR) const; |
108 | 108 |
109 SK_DEFINE_FLATTENABLE_TYPE(SkPathEffect) | 109 SK_DEFINE_FLATTENABLE_TYPE(SkPathEffect) |
110 | 110 |
111 protected: | 111 protected: |
112 SkPathEffect(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) {} | 112 SkPathEffect(SkReadBuffer& buffer) : INHERITED(buffer) {} |
113 | 113 |
114 private: | 114 private: |
115 // illegal | 115 // illegal |
116 SkPathEffect(const SkPathEffect&); | 116 SkPathEffect(const SkPathEffect&); |
117 SkPathEffect& operator=(const SkPathEffect&); | 117 SkPathEffect& operator=(const SkPathEffect&); |
118 | 118 |
119 typedef SkFlattenable INHERITED; | 119 typedef SkFlattenable INHERITED; |
120 }; | 120 }; |
121 | 121 |
122 /** \class SkPairPathEffect | 122 /** \class SkPairPathEffect |
123 | 123 |
124 Common baseclass for Compose and Sum. This subclass manages two pathEffects, | 124 Common baseclass for Compose and Sum. This subclass manages two pathEffects, |
125 including flattening them. It does nothing in filterPath, and is only useful | 125 including flattening them. It does nothing in filterPath, and is only useful |
126 for managing the lifetimes of its two arguments. | 126 for managing the lifetimes of its two arguments. |
127 */ | 127 */ |
128 class SkPairPathEffect : public SkPathEffect { | 128 class SkPairPathEffect : public SkPathEffect { |
129 public: | 129 public: |
130 SkPairPathEffect(SkPathEffect* pe0, SkPathEffect* pe1); | 130 SkPairPathEffect(SkPathEffect* pe0, SkPathEffect* pe1); |
131 virtual ~SkPairPathEffect(); | 131 virtual ~SkPairPathEffect(); |
132 | 132 |
133 protected: | 133 protected: |
134 SkPairPathEffect(SkFlattenableReadBuffer&); | 134 SkPairPathEffect(SkReadBuffer&); |
135 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; | 135 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; |
136 | 136 |
137 // these are visible to our subclasses | 137 // these are visible to our subclasses |
138 SkPathEffect* fPE0, *fPE1; | 138 SkPathEffect* fPE0, *fPE1; |
139 | 139 |
140 private: | 140 private: |
141 typedef SkPathEffect INHERITED; | 141 typedef SkPathEffect INHERITED; |
142 }; | 142 }; |
143 | 143 |
144 /** \class SkComposePathEffect | 144 /** \class SkComposePathEffect |
145 | 145 |
146 This subclass of SkPathEffect composes its two arguments, to create | 146 This subclass of SkPathEffect composes its two arguments, to create |
147 a compound pathEffect. | 147 a compound pathEffect. |
148 */ | 148 */ |
149 class SkComposePathEffect : public SkPairPathEffect { | 149 class SkComposePathEffect : public SkPairPathEffect { |
150 public: | 150 public: |
151 /** Construct a pathEffect whose effect is to apply first the inner pathEffe
ct | 151 /** Construct a pathEffect whose effect is to apply first the inner pathEffe
ct |
152 and the the outer pathEffect (e.g. outer(inner(path))) | 152 and the the outer pathEffect (e.g. outer(inner(path))) |
153 The reference counts for outer and inner are both incremented in the con
structor, | 153 The reference counts for outer and inner are both incremented in the con
structor, |
154 and decremented in the destructor. | 154 and decremented in the destructor. |
155 */ | 155 */ |
156 SkComposePathEffect(SkPathEffect* outer, SkPathEffect* inner) | 156 SkComposePathEffect(SkPathEffect* outer, SkPathEffect* inner) |
157 : INHERITED(outer, inner) {} | 157 : INHERITED(outer, inner) {} |
158 | 158 |
159 virtual bool filterPath(SkPath* dst, const SkPath& src, | 159 virtual bool filterPath(SkPath* dst, const SkPath& src, |
160 SkStrokeRec*, const SkRect*) const SK_OVERRIDE; | 160 SkStrokeRec*, const SkRect*) const SK_OVERRIDE; |
161 | 161 |
162 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkComposePathEffect) | 162 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkComposePathEffect) |
163 | 163 |
164 protected: | 164 protected: |
165 SkComposePathEffect(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) {} | 165 SkComposePathEffect(SkReadBuffer& buffer) : INHERITED(buffer) {} |
166 | 166 |
167 private: | 167 private: |
168 // illegal | 168 // illegal |
169 SkComposePathEffect(const SkComposePathEffect&); | 169 SkComposePathEffect(const SkComposePathEffect&); |
170 SkComposePathEffect& operator=(const SkComposePathEffect&); | 170 SkComposePathEffect& operator=(const SkComposePathEffect&); |
171 | 171 |
172 typedef SkPairPathEffect INHERITED; | 172 typedef SkPairPathEffect INHERITED; |
173 }; | 173 }; |
174 | 174 |
175 /** \class SkSumPathEffect | 175 /** \class SkSumPathEffect |
(...skipping 10 matching lines...) Expand all Loading... |
186 */ | 186 */ |
187 SkSumPathEffect(SkPathEffect* first, SkPathEffect* second) | 187 SkSumPathEffect(SkPathEffect* first, SkPathEffect* second) |
188 : INHERITED(first, second) {} | 188 : INHERITED(first, second) {} |
189 | 189 |
190 virtual bool filterPath(SkPath* dst, const SkPath& src, | 190 virtual bool filterPath(SkPath* dst, const SkPath& src, |
191 SkStrokeRec*, const SkRect*) const SK_OVERRIDE; | 191 SkStrokeRec*, const SkRect*) const SK_OVERRIDE; |
192 | 192 |
193 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkSumPathEffect) | 193 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkSumPathEffect) |
194 | 194 |
195 protected: | 195 protected: |
196 SkSumPathEffect(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) {} | 196 SkSumPathEffect(SkReadBuffer& buffer) : INHERITED(buffer) {} |
197 | 197 |
198 private: | 198 private: |
199 // illegal | 199 // illegal |
200 SkSumPathEffect(const SkSumPathEffect&); | 200 SkSumPathEffect(const SkSumPathEffect&); |
201 SkSumPathEffect& operator=(const SkSumPathEffect&); | 201 SkSumPathEffect& operator=(const SkSumPathEffect&); |
202 | 202 |
203 typedef SkPairPathEffect INHERITED; | 203 typedef SkPairPathEffect INHERITED; |
204 }; | 204 }; |
205 | 205 |
206 #endif | 206 #endif |
OLD | NEW |