| 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 SkXfermode_DEFINED | 10 #ifndef SkXfermode_DEFINED |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 will install it and own a ref to it. Since the xfermode may or may not a
ssign *xpf, the | 210 will install it and own a ref to it. Since the xfermode may or may not a
ssign *xpf, the |
| 211 caller should set *xpf to NULL beforehand. XP's cannot use a background
texture since they | 211 caller should set *xpf to NULL beforehand. XP's cannot use a background
texture since they |
| 212 have no coord transforms. | 212 have no coord transforms. |
| 213 */ | 213 */ |
| 214 virtual bool asXPFactory(GrXPFactory** xpf) const; | 214 virtual bool asXPFactory(GrXPFactory** xpf) const; |
| 215 | 215 |
| 216 /** Returns true if the xfermode can be expressed as an xfer processor facto
ry (xpFactory), | 216 /** Returns true if the xfermode can be expressed as an xfer processor facto
ry (xpFactory), |
| 217 or a fragment processor. This helper calls the asCoeff(), asXPFactory(), | 217 or a fragment processor. This helper calls the asCoeff(), asXPFactory(), |
| 218 and asFragmentProcessor() virtuals. If the xfermode is NULL, it is treat
ed as kSrcOver_Mode. | 218 and asFragmentProcessor() virtuals. If the xfermode is NULL, it is treat
ed as kSrcOver_Mode. |
| 219 It is legal to call this with all params NULL to simply test the return
value. | 219 It is legal to call this with all params NULL to simply test the return
value. |
| 220 fp and xpf must both be NULL or all non-NULL. | 220 fp, xpf, src, and dst must all be NULL or all non-NULL. |
| 221 */ | 221 */ |
| 222 static bool AsFragmentProcessorOrXPFactory(SkXfermode*, GrFragmentProcessor*
*, | 222 static bool AsFragmentProcessorOrXPFactory(SkXfermode*, GrFragmentProcessor*
*, |
| 223 GrXPFactory**); | 223 GrXPFactory**, Coeff* src, Coeff*
dst); |
| 224 | 224 |
| 225 SK_TO_STRING_PUREVIRT() | 225 SK_TO_STRING_PUREVIRT() |
| 226 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() | 226 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() |
| 227 SK_DEFINE_FLATTENABLE_TYPE(SkXfermode) | 227 SK_DEFINE_FLATTENABLE_TYPE(SkXfermode) |
| 228 | 228 |
| 229 protected: | 229 protected: |
| 230 SkXfermode() {} | 230 SkXfermode() {} |
| 231 /** The default implementation of xfer32/xfer16/xferA8 in turn call this | 231 /** The default implementation of xfer32/xfer16/xferA8 in turn call this |
| 232 method, 1 color at a time (upscaled to a SkPMColor). The default | 232 method, 1 color at a time (upscaled to a SkPMColor). The default |
| 233 implmentation of this method just returns dst. If performance is | 233 implmentation of this method just returns dst. If performance is |
| 234 important, your subclass should override xfer32/xfer16/xferA8 directly. | 234 important, your subclass should override xfer32/xfer16/xferA8 directly. |
| 235 | 235 |
| 236 This method will not be called directly by the client, so it need not | 236 This method will not be called directly by the client, so it need not |
| 237 be implemented if your subclass has overridden xfer32/xfer16/xferA8 | 237 be implemented if your subclass has overridden xfer32/xfer16/xferA8 |
| 238 */ | 238 */ |
| 239 virtual SkPMColor xferColor(SkPMColor src, SkPMColor dst) const; | 239 virtual SkPMColor xferColor(SkPMColor src, SkPMColor dst) const; |
| 240 | 240 |
| 241 private: | 241 private: |
| 242 enum { | 242 enum { |
| 243 kModeCount = kLastMode + 1 | 243 kModeCount = kLastMode + 1 |
| 244 }; | 244 }; |
| 245 | 245 |
| 246 typedef SkFlattenable INHERITED; | 246 typedef SkFlattenable INHERITED; |
| 247 }; | 247 }; |
| 248 | 248 |
| 249 #endif | 249 #endif |
| OLD | NEW |