OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkAvoidXfermode_DEFINED | 8 #ifndef SkAvoidXfermode_DEFINED |
9 #define SkAvoidXfermode_DEFINED | 9 #define SkAvoidXfermode_DEFINED |
10 | 10 |
11 #include "SkXfermode.h" | 11 #include "SkXfermode.h" |
12 | 12 |
13 /** \class SkAvoidXfermode | 13 /** \class SkAvoidXfermode |
14 | 14 |
15 This xfermode will draw the src everywhere except on top of the specified | 15 This xfermode will draw the src everywhere except on top of the specified |
16 color. | 16 color. |
17 */ | 17 */ |
18 class SK_API SkAvoidXfermode : public SkXfermode { | 18 class SK_API SkAvoidXfermode : public SkXfermode { |
| 19 typedef SkXfermode INHERITED; |
| 20 |
19 public: | 21 public: |
20 enum Mode { | 22 enum Mode { |
21 kAvoidColor_Mode, //!< draw everywhere except on the opColor | 23 kAvoidColor_Mode, //!< draw everywhere except on the opColor |
22 kTargetColor_Mode //!< draw only on top of the opColor | 24 kTargetColor_Mode //!< draw only on top of the opColor |
23 }; | 25 }; |
24 | 26 |
25 /** This xfermode draws, or doesn't draw, based on the destination's | 27 /** This xfermode draws, or doesn't draw, based on the destination's |
26 distance from an op-color. | 28 distance from an op-color. |
27 | 29 |
28 There are two modes, and each mode interprets a tolerance value. | 30 There are two modes, and each mode interprets a tolerance value. |
(...skipping 22 matching lines...) Expand all Loading... |
51 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkAvoidXfermode) | 53 SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkAvoidXfermode) |
52 | 54 |
53 protected: | 55 protected: |
54 SkAvoidXfermode(SkFlattenableReadBuffer&); | 56 SkAvoidXfermode(SkFlattenableReadBuffer&); |
55 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; | 57 virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE; |
56 | 58 |
57 private: | 59 private: |
58 SkColor fOpColor; | 60 SkColor fOpColor; |
59 uint32_t fDistMul; // x.14 | 61 uint32_t fDistMul; // x.14 |
60 Mode fMode; | 62 Mode fMode; |
61 | |
62 typedef SkXfermode INHERITED; | |
63 }; | 63 }; |
64 | 64 |
65 #endif | 65 #endif |
OLD | NEW |