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 |
11 #define SkXfermode_DEFINED | 11 #define SkXfermode_DEFINED |
12 | 12 |
13 #include "SkFlattenable.h" | 13 #include "SkFlattenable.h" |
14 #include "SkColor.h" | 14 #include "SkColor.h" |
15 | 15 |
16 class GrEffectRef; | 16 class GrEffectRef; |
17 class GrTexture; | 17 class GrTexture; |
18 class SkString; | 18 class SkString; |
19 | 19 |
| 20 //#define SK_SUPPORT_LEGACY_PROCXFERMODE |
| 21 |
20 /** \class SkXfermode | 22 /** \class SkXfermode |
21 * | 23 * |
22 * SkXfermode is the base class for objects that are called to implement custom | 24 * SkXfermode is the base class for objects that are called to implement custom |
23 * "transfer-modes" in the drawing pipeline. The static function Create(Modes) | 25 * "transfer-modes" in the drawing pipeline. The static function Create(Modes) |
24 * can be called to return an instance of any of the predefined subclasses as | 26 * can be called to return an instance of any of the predefined subclasses as |
25 * specified in the Modes enum. When an SkXfermode is assigned to an SkPaint, | 27 * specified in the Modes enum. When an SkXfermode is assigned to an SkPaint, |
26 * then objects drawn with that paint have the xfermode applied. | 28 * then objects drawn with that paint have the xfermode applied. |
27 * | 29 * |
28 * All subclasses are required to be reentrant-safe : it must be legal to share | 30 * All subclasses are required to be reentrant-safe : it must be legal to share |
29 * the same instance between several threads. | 31 * the same instance between several threads. |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 }; | 241 }; |
240 | 242 |
241 friend class SkGraphics; | 243 friend class SkGraphics; |
242 static void Term(); | 244 static void Term(); |
243 | 245 |
244 typedef SkFlattenable INHERITED; | 246 typedef SkFlattenable INHERITED; |
245 }; | 247 }; |
246 | 248 |
247 /////////////////////////////////////////////////////////////////////////////// | 249 /////////////////////////////////////////////////////////////////////////////// |
248 | 250 |
| 251 #ifdef SK_SUPPORT_LEGACY_PROCXFERMODE |
249 /** \class SkProcXfermode | 252 /** \class SkProcXfermode |
250 | 253 |
251 SkProcXfermode is a xfermode that applies the specified proc to its colors. | 254 SkProcXfermode is a xfermode that applies the specified proc to its colors. |
252 This class is not exported to java. | 255 This class is not exported to java. |
253 */ | 256 */ |
254 class SK_API SkProcXfermode : public SkXfermode { | 257 class SK_API SkProcXfermode : public SkXfermode { |
255 public: | 258 public: |
256 static SkProcXfermode* Create(SkXfermodeProc proc) { | 259 static SkProcXfermode* Create(SkXfermodeProc proc) { |
257 return SkNEW_ARGS(SkProcXfermode, (proc)); | 260 return SkNEW_ARGS(SkProcXfermode, (proc)); |
258 } | 261 } |
(...skipping 25 matching lines...) Expand all Loading... |
284 #ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS | 287 #ifdef SK_SUPPORT_LEGACY_PUBLICEFFECTCONSTRUCTORS |
285 public: | 288 public: |
286 #endif | 289 #endif |
287 SkProcXfermode(SkXfermodeProc proc) : fProc(proc) {} | 290 SkProcXfermode(SkXfermodeProc proc) : fProc(proc) {} |
288 | 291 |
289 private: | 292 private: |
290 SkXfermodeProc fProc; | 293 SkXfermodeProc fProc; |
291 | 294 |
292 typedef SkXfermode INHERITED; | 295 typedef SkXfermode INHERITED; |
293 }; | 296 }; |
| 297 #endif |
294 | 298 |
295 #endif | 299 #endif |
OLD | NEW |