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

Side by Side Diff: include/core/SkPathEffect.h

Issue 395603002: Simplify flattening to just write enough to call the factory (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 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
OLDNEW
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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 SkScalar fPhase; //!< Offset into the dashed interval pat tern 128 SkScalar fPhase; //!< Offset into the dashed interval pat tern
129 // mod the sum of all intervals 129 // mod the sum of all intervals
130 }; 130 };
131 131
132 virtual DashType asADash(DashInfo* info) const; 132 virtual DashType asADash(DashInfo* info) const;
133 133
134 SK_DEFINE_FLATTENABLE_TYPE(SkPathEffect) 134 SK_DEFINE_FLATTENABLE_TYPE(SkPathEffect)
135 135
136 protected: 136 protected:
137 SkPathEffect() {} 137 SkPathEffect() {}
138 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
138 SkPathEffect(SkReadBuffer& buffer) : INHERITED(buffer) {} 139 SkPathEffect(SkReadBuffer& buffer) : INHERITED(buffer) {}
140 #endif
139 141
140 private: 142 private:
141 // illegal 143 // illegal
142 SkPathEffect(const SkPathEffect&); 144 SkPathEffect(const SkPathEffect&);
143 SkPathEffect& operator=(const SkPathEffect&); 145 SkPathEffect& operator=(const SkPathEffect&);
144 146
145 typedef SkFlattenable INHERITED; 147 typedef SkFlattenable INHERITED;
146 }; 148 };
147 149
148 /** \class SkPairPathEffect 150 /** \class SkPairPathEffect
149 151
150 Common baseclass for Compose and Sum. This subclass manages two pathEffects, 152 Common baseclass for Compose and Sum. This subclass manages two pathEffects,
151 including flattening them. It does nothing in filterPath, and is only useful 153 including flattening them. It does nothing in filterPath, and is only useful
152 for managing the lifetimes of its two arguments. 154 for managing the lifetimes of its two arguments.
153 */ 155 */
154 class SkPairPathEffect : public SkPathEffect { 156 class SkPairPathEffect : public SkPathEffect {
155 public: 157 public:
156 virtual ~SkPairPathEffect(); 158 virtual ~SkPairPathEffect();
157 159
158 protected: 160 protected:
159 SkPairPathEffect(SkPathEffect* pe0, SkPathEffect* pe1); 161 SkPairPathEffect(SkPathEffect* pe0, SkPathEffect* pe1);
162 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
160 SkPairPathEffect(SkReadBuffer&); 163 SkPairPathEffect(SkReadBuffer&);
164 #endif
165
161 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; 166 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE;
162 167
163 // these are visible to our subclasses 168 // these are visible to our subclasses
164 SkPathEffect* fPE0, *fPE1; 169 SkPathEffect* fPE0, *fPE1;
165 170
166 private: 171 private:
167 typedef SkPathEffect INHERITED; 172 typedef SkPathEffect INHERITED;
168 }; 173 };
169 174
170 /** \class SkComposePathEffect 175 /** \class SkComposePathEffect
(...skipping 13 matching lines...) Expand all
184 } 189 }
185 190
186 virtual bool filterPath(SkPath* dst, const SkPath& src, 191 virtual bool filterPath(SkPath* dst, const SkPath& src,
187 SkStrokeRec*, const SkRect*) const SK_OVERRIDE; 192 SkStrokeRec*, const SkRect*) const SK_OVERRIDE;
188 193
189 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkComposePathEffect) 194 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkComposePathEffect)
190 195
191 protected: 196 protected:
192 SkComposePathEffect(SkPathEffect* outer, SkPathEffect* inner) 197 SkComposePathEffect(SkPathEffect* outer, SkPathEffect* inner)
193 : INHERITED(outer, inner) {} 198 : INHERITED(outer, inner) {}
199
200 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
194 explicit SkComposePathEffect(SkReadBuffer& buffer) : INHERITED(buffer) {} 201 explicit SkComposePathEffect(SkReadBuffer& buffer) : INHERITED(buffer) {}
202 #endif
195 203
196 private: 204 private:
197 // illegal 205 // illegal
198 SkComposePathEffect(const SkComposePathEffect&); 206 SkComposePathEffect(const SkComposePathEffect&);
199 SkComposePathEffect& operator=(const SkComposePathEffect&); 207 SkComposePathEffect& operator=(const SkComposePathEffect&);
200 208
201 typedef SkPairPathEffect INHERITED; 209 typedef SkPairPathEffect INHERITED;
202 }; 210 };
203 211
204 /** \class SkSumPathEffect 212 /** \class SkSumPathEffect
(...skipping 13 matching lines...) Expand all
218 } 226 }
219 227
220 virtual bool filterPath(SkPath* dst, const SkPath& src, 228 virtual bool filterPath(SkPath* dst, const SkPath& src,
221 SkStrokeRec*, const SkRect*) const SK_OVERRIDE; 229 SkStrokeRec*, const SkRect*) const SK_OVERRIDE;
222 230
223 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkSumPathEffect) 231 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkSumPathEffect)
224 232
225 protected: 233 protected:
226 SkSumPathEffect(SkPathEffect* first, SkPathEffect* second) 234 SkSumPathEffect(SkPathEffect* first, SkPathEffect* second)
227 : INHERITED(first, second) {} 235 : INHERITED(first, second) {}
236
237 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
228 explicit SkSumPathEffect(SkReadBuffer& buffer) : INHERITED(buffer) {} 238 explicit SkSumPathEffect(SkReadBuffer& buffer) : INHERITED(buffer) {}
239 #endif
229 240
230 private: 241 private:
231 // illegal 242 // illegal
232 SkSumPathEffect(const SkSumPathEffect&); 243 SkSumPathEffect(const SkSumPathEffect&);
233 SkSumPathEffect& operator=(const SkSumPathEffect&); 244 SkSumPathEffect& operator=(const SkSumPathEffect&);
234 245
235 typedef SkPairPathEffect INHERITED; 246 typedef SkPairPathEffect INHERITED;
236 }; 247 };
237 248
238 #endif 249 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698