| 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 | 146 |
| 147 typedef SkFlattenable INHERITED; | 147 typedef SkFlattenable INHERITED; |
| 148 }; | 148 }; |
| 149 | 149 |
| 150 /** \class SkPairPathEffect | 150 /** \class SkPairPathEffect |
| 151 | 151 |
| 152 Common baseclass for Compose and Sum. This subclass manages two pathEffects, | 152 Common baseclass for Compose and Sum. This subclass manages two pathEffects, |
| 153 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 |
| 154 for managing the lifetimes of its two arguments. | 154 for managing the lifetimes of its two arguments. |
| 155 */ | 155 */ |
| 156 class SkPairPathEffect : public SkPathEffect { | 156 class SK_API SkPairPathEffect : public SkPathEffect { |
| 157 protected: | 157 protected: |
| 158 SkPairPathEffect(sk_sp<SkPathEffect> pe0, sk_sp<SkPathEffect> pe1); | 158 SkPairPathEffect(sk_sp<SkPathEffect> pe0, sk_sp<SkPathEffect> pe1); |
| 159 | 159 |
| 160 void flatten(SkWriteBuffer&) const override; | 160 void flatten(SkWriteBuffer&) const override; |
| 161 | 161 |
| 162 // these are visible to our subclasses | 162 // these are visible to our subclasses |
| 163 sk_sp<SkPathEffect> fPE0; | 163 sk_sp<SkPathEffect> fPE0; |
| 164 sk_sp<SkPathEffect> fPE1; | 164 sk_sp<SkPathEffect> fPE1; |
| 165 | 165 |
| 166 SK_TO_STRING_OVERRIDE() | 166 SK_TO_STRING_OVERRIDE() |
| 167 | 167 |
| 168 private: | 168 private: |
| 169 typedef SkPathEffect INHERITED; | 169 typedef SkPathEffect INHERITED; |
| 170 }; | 170 }; |
| 171 | 171 |
| 172 /** \class SkComposePathEffect | 172 /** \class SkComposePathEffect |
| 173 | 173 |
| 174 This subclass of SkPathEffect composes its two arguments, to create | 174 This subclass of SkPathEffect composes its two arguments, to create |
| 175 a compound pathEffect. | 175 a compound pathEffect. |
| 176 */ | 176 */ |
| 177 class SkComposePathEffect : public SkPairPathEffect { | 177 class SK_API SkComposePathEffect : public SkPairPathEffect { |
| 178 public: | 178 public: |
| 179 /** Construct a pathEffect whose effect is to apply first the inner pathEffe
ct | 179 /** Construct a pathEffect whose effect is to apply first the inner pathEffe
ct |
| 180 and the the outer pathEffect (e.g. outer(inner(path))) | 180 and the the outer pathEffect (e.g. outer(inner(path))) |
| 181 The reference counts for outer and inner are both incremented in the con
structor, | 181 The reference counts for outer and inner are both incremented in the con
structor, |
| 182 and decremented in the destructor. | 182 and decremented in the destructor. |
| 183 */ | 183 */ |
| 184 static sk_sp<SkPathEffect> Make(sk_sp<SkPathEffect> outer, sk_sp<SkPathEffec
t> inner) { | 184 static sk_sp<SkPathEffect> Make(sk_sp<SkPathEffect> outer, sk_sp<SkPathEffec
t> inner) { |
| 185 if (!outer) { | 185 if (!outer) { |
| 186 return inner; | 186 return inner; |
| 187 } | 187 } |
| (...skipping 29 matching lines...) Expand all Loading... |
| 217 SkComposePathEffect& operator=(const SkComposePathEffect&); | 217 SkComposePathEffect& operator=(const SkComposePathEffect&); |
| 218 | 218 |
| 219 typedef SkPairPathEffect INHERITED; | 219 typedef SkPairPathEffect INHERITED; |
| 220 }; | 220 }; |
| 221 | 221 |
| 222 /** \class SkSumPathEffect | 222 /** \class SkSumPathEffect |
| 223 | 223 |
| 224 This subclass of SkPathEffect applies two pathEffects, one after the other. | 224 This subclass of SkPathEffect applies two pathEffects, one after the other. |
| 225 Its filterPath() returns true if either of the effects succeeded. | 225 Its filterPath() returns true if either of the effects succeeded. |
| 226 */ | 226 */ |
| 227 class SkSumPathEffect : public SkPairPathEffect { | 227 class SK_API SkSumPathEffect : public SkPairPathEffect { |
| 228 public: | 228 public: |
| 229 /** Construct a pathEffect whose effect is to apply two effects, in sequence
. | 229 /** Construct a pathEffect whose effect is to apply two effects, in sequence
. |
| 230 (e.g. first(path) + second(path)) | 230 (e.g. first(path) + second(path)) |
| 231 The reference counts for first and second are both incremented in the co
nstructor, | 231 The reference counts for first and second are both incremented in the co
nstructor, |
| 232 and decremented in the destructor. | 232 and decremented in the destructor. |
| 233 */ | 233 */ |
| 234 static sk_sp<SkPathEffect> Make(sk_sp<SkPathEffect> first, sk_sp<SkPathEffec
t> second) { | 234 static sk_sp<SkPathEffect> Make(sk_sp<SkPathEffect> first, sk_sp<SkPathEffec
t> second) { |
| 235 if (!first) { | 235 if (!first) { |
| 236 return second; | 236 return second; |
| 237 } | 237 } |
| (...skipping 24 matching lines...) Expand all Loading... |
| 262 | 262 |
| 263 private: | 263 private: |
| 264 // illegal | 264 // illegal |
| 265 SkSumPathEffect(const SkSumPathEffect&); | 265 SkSumPathEffect(const SkSumPathEffect&); |
| 266 SkSumPathEffect& operator=(const SkSumPathEffect&); | 266 SkSumPathEffect& operator=(const SkSumPathEffect&); |
| 267 | 267 |
| 268 typedef SkPairPathEffect INHERITED; | 268 typedef SkPairPathEffect INHERITED; |
| 269 }; | 269 }; |
| 270 | 270 |
| 271 #endif | 271 #endif |
| OLD | NEW |