| 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 (effect). This helper calls the asCoeff() and asNewEffect() virtuals. If
the xfermode is | 204 (effect). This helper calls the asCoeff() and asNewEffect() virtuals. If
the xfermode is |
| 205 NULL, it is treated as kSrcOver_Mode. It is legal to call this with all
params NULL to | 205 NULL, it is treated as kSrcOver_Mode. It is legal to call this with all
params NULL to |
| 206 simply test the return value. effect, src, and dst must all be NULL or
all non-NULL. | 206 simply test the return value. effect, src, and dst must all be NULL or
all non-NULL. |
| 207 */ | 207 */ |
| 208 static bool AsNewEffectOrCoeff(SkXfermode*, | 208 static bool AsNewEffectOrCoeff(SkXfermode*, |
| 209 GrEffectRef** effect, | 209 GrEffectRef** effect, |
| 210 Coeff* src, | 210 Coeff* src, |
| 211 Coeff* dst, | 211 Coeff* dst, |
| 212 GrTexture* background = NULL); | 212 GrTexture* background = NULL); |
| 213 | 213 |
| 214 SkDEVCODE(virtual void toString(SkString* str) const = 0;) | 214 SK_TO_STRING_PUREVIRT() |
| 215 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() | 215 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() |
| 216 SK_DEFINE_FLATTENABLE_TYPE(SkXfermode) | 216 SK_DEFINE_FLATTENABLE_TYPE(SkXfermode) |
| 217 | 217 |
| 218 protected: | 218 protected: |
| 219 SkXfermode(SkReadBuffer& rb) : SkFlattenable(rb) {} | 219 SkXfermode(SkReadBuffer& rb) : SkFlattenable(rb) {} |
| 220 | 220 |
| 221 /** The default implementation of xfer32/xfer16/xferA8 in turn call this | 221 /** The default implementation of xfer32/xfer16/xferA8 in turn call this |
| 222 method, 1 color at a time (upscaled to a SkPMColor). The default | 222 method, 1 color at a time (upscaled to a SkPMColor). The default |
| 223 implmentation of this method just returns dst. If performance is | 223 implmentation of this method just returns dst. If performance is |
| 224 important, your subclass should override xfer32/xfer16/xferA8 directly. | 224 important, your subclass should override xfer32/xfer16/xferA8 directly. |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 } | 258 } |
| 259 | 259 |
| 260 // overrides from SkXfermode | 260 // overrides from SkXfermode |
| 261 virtual void xfer32(SkPMColor dst[], const SkPMColor src[], int count, | 261 virtual void xfer32(SkPMColor dst[], const SkPMColor src[], int count, |
| 262 const SkAlpha aa[]) const SK_OVERRIDE; | 262 const SkAlpha aa[]) const SK_OVERRIDE; |
| 263 virtual void xfer16(uint16_t dst[], const SkPMColor src[], int count, | 263 virtual void xfer16(uint16_t dst[], const SkPMColor src[], int count, |
| 264 const SkAlpha aa[]) const SK_OVERRIDE; | 264 const SkAlpha aa[]) const SK_OVERRIDE; |
| 265 virtual void xferA8(SkAlpha dst[], const SkPMColor src[], int count, | 265 virtual void xferA8(SkAlpha dst[], const SkPMColor src[], int count, |
| 266 const SkAlpha aa[]) const SK_OVERRIDE; | 266 const SkAlpha aa[]) const SK_OVERRIDE; |
| 267 | 267 |
| 268 SK_DEVELOPER_TO_STRING() | 268 SK_TO_STRING_OVERRIDE() |
| 269 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkProcXfermode) | 269 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkProcXfermode) |
| 270 | 270 |
| 271 protected: | 271 protected: |
| 272 SkProcXfermode(SkReadBuffer&); | 272 SkProcXfermode(SkReadBuffer&); |
| 273 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; | 273 virtual void flatten(SkWriteBuffer&) const SK_OVERRIDE; |
| 274 | 274 |
| 275 // allow subclasses to update this after we unflatten | 275 // allow subclasses to update this after we unflatten |
| 276 void setProc(SkXfermodeProc proc) { | 276 void setProc(SkXfermodeProc proc) { |
| 277 fProc = proc; | 277 fProc = proc; |
| 278 } | 278 } |
| 279 | 279 |
| 280 SkXfermodeProc getProc() const { | 280 SkXfermodeProc getProc() const { |
| 281 return fProc; | 281 return fProc; |
| 282 } | 282 } |
| 283 | 283 |
| 284 #ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS | 284 #ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS |
| 285 public: | 285 public: |
| 286 #endif | 286 #endif |
| 287 SkProcXfermode(SkXfermodeProc proc) : fProc(proc) {} | 287 SkProcXfermode(SkXfermodeProc proc) : fProc(proc) {} |
| 288 | 288 |
| 289 private: | 289 private: |
| 290 SkXfermodeProc fProc; | 290 SkXfermodeProc fProc; |
| 291 | 291 |
| 292 typedef SkXfermode INHERITED; | 292 typedef SkXfermode INHERITED; |
| 293 }; | 293 }; |
| 294 | 294 |
| 295 #endif | 295 #endif |
| OLD | NEW |