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

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

Issue 23021015: Initial error handling code (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fixing comments Created 7 years, 2 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 | Annotate | Revision Log
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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 }; 99 };
100 100
101 /** 101 /**
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_CHECKING_PROCS(SkPathEffect)
110
109 protected: 111 protected:
110 SkPathEffect(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) {} 112 SkPathEffect(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) {}
111 113
112 private: 114 private:
113 // illegal 115 // illegal
114 SkPathEffect(const SkPathEffect&); 116 SkPathEffect(const SkPathEffect&);
115 SkPathEffect& operator=(const SkPathEffect&); 117 SkPathEffect& operator=(const SkPathEffect&);
116 118
117 typedef SkFlattenable INHERITED; 119 typedef SkFlattenable INHERITED;
118 }; 120 };
119 121
120 /** \class SkPairPathEffect 122 /** \class SkPairPathEffect
121 123
122 Common baseclass for Compose and Sum. This subclass manages two pathEffects, 124 Common baseclass for Compose and Sum. This subclass manages two pathEffects,
123 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
124 for managing the lifetimes of its two arguments. 126 for managing the lifetimes of its two arguments.
125 */ 127 */
126 class SkPairPathEffect : public SkPathEffect { 128 class SkPairPathEffect : public SkPathEffect {
127 public: 129 public:
128 SkPairPathEffect(SkPathEffect* pe0, SkPathEffect* pe1); 130 SkPairPathEffect(SkPathEffect* pe0, SkPathEffect* pe1);
129 virtual ~SkPairPathEffect(); 131 virtual ~SkPairPathEffect();
130 132
133 SK_DEFINE_FLATTENABLE_TYPE_CHECKING_PROCS(SkPairPathEffect)
134
131 protected: 135 protected:
132 SkPairPathEffect(SkFlattenableReadBuffer&); 136 SkPairPathEffect(SkFlattenableReadBuffer&);
133 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; 137 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE;
134 138
135 // these are visible to our subclasses 139 // these are visible to our subclasses
136 SkPathEffect* fPE0, *fPE1; 140 SkPathEffect* fPE0, *fPE1;
137 141
138 private: 142 private:
139 typedef SkPathEffect INHERITED; 143 typedef SkPathEffect INHERITED;
140 }; 144 };
141 145
142 /** \class SkComposePathEffect 146 /** \class SkComposePathEffect
143 147
144 This subclass of SkPathEffect composes its two arguments, to create 148 This subclass of SkPathEffect composes its two arguments, to create
145 a compound pathEffect. 149 a compound pathEffect.
146 */ 150 */
147 class SkComposePathEffect : public SkPairPathEffect { 151 class SkComposePathEffect : public SkPairPathEffect {
148 public: 152 public:
149 /** Construct a pathEffect whose effect is to apply first the inner pathEffe ct 153 /** Construct a pathEffect whose effect is to apply first the inner pathEffe ct
150 and the the outer pathEffect (e.g. outer(inner(path))) 154 and the the outer pathEffect (e.g. outer(inner(path)))
151 The reference counts for outer and inner are both incremented in the con structor, 155 The reference counts for outer and inner are both incremented in the con structor,
152 and decremented in the destructor. 156 and decremented in the destructor.
153 */ 157 */
154 SkComposePathEffect(SkPathEffect* outer, SkPathEffect* inner) 158 SkComposePathEffect(SkPathEffect* outer, SkPathEffect* inner)
155 : INHERITED(outer, inner) {} 159 : INHERITED(outer, inner) {}
156 160
157 virtual bool filterPath(SkPath* dst, const SkPath& src, 161 virtual bool filterPath(SkPath* dst, const SkPath& src,
158 SkStrokeRec*, const SkRect*) const SK_OVERRIDE; 162 SkStrokeRec*, const SkRect*) const SK_OVERRIDE;
159 163
160 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkComposePathEffect) 164 SK_DEFINE_FLATTENABLE_DESERIALIZATION_PROCS(SkComposePathEffect)
161 165
162 protected: 166 protected:
163 SkComposePathEffect(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) {} 167 SkComposePathEffect(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) {}
164 168
165 private: 169 private:
166 // illegal 170 // illegal
167 SkComposePathEffect(const SkComposePathEffect&); 171 SkComposePathEffect(const SkComposePathEffect&);
168 SkComposePathEffect& operator=(const SkComposePathEffect&); 172 SkComposePathEffect& operator=(const SkComposePathEffect&);
169 173
170 typedef SkPairPathEffect INHERITED; 174 typedef SkPairPathEffect INHERITED;
(...skipping 10 matching lines...) Expand all
181 (e.g. first(path) + second(path)) 185 (e.g. first(path) + second(path))
182 The reference counts for first and second are both incremented in the co nstructor, 186 The reference counts for first and second are both incremented in the co nstructor,
183 and decremented in the destructor. 187 and decremented in the destructor.
184 */ 188 */
185 SkSumPathEffect(SkPathEffect* first, SkPathEffect* second) 189 SkSumPathEffect(SkPathEffect* first, SkPathEffect* second)
186 : INHERITED(first, second) {} 190 : INHERITED(first, second) {}
187 191
188 virtual bool filterPath(SkPath* dst, const SkPath& src, 192 virtual bool filterPath(SkPath* dst, const SkPath& src,
189 SkStrokeRec*, const SkRect*) const SK_OVERRIDE; 193 SkStrokeRec*, const SkRect*) const SK_OVERRIDE;
190 194
191 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkSumPathEffect) 195 SK_DEFINE_FLATTENABLE_DESERIALIZATION_PROCS(SkSumPathEffect)
192 196
193 protected: 197 protected:
194 SkSumPathEffect(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) {} 198 SkSumPathEffect(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) {}
195 199
196 private: 200 private:
197 // illegal 201 // illegal
198 SkSumPathEffect(const SkSumPathEffect&); 202 SkSumPathEffect(const SkSumPathEffect&);
199 SkSumPathEffect& operator=(const SkSumPathEffect&); 203 SkSumPathEffect& operator=(const SkSumPathEffect&);
200 204
201 typedef SkPairPathEffect INHERITED; 205 typedef SkPairPathEffect INHERITED;
202 }; 206 };
203 207
204 #endif 208 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698