| 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 SkPorterDuff_DEFINED | 8 #ifndef SkPorterDuff_DEFINED |
| 9 #define SkPorterDuff_DEFINED | 9 #define SkPorterDuff_DEFINED |
| 10 | 10 |
| 11 #include "SkColor.h" | 11 #include "SkColor.h" |
| 12 #include "SkXfermode.h" | 12 #include "SkXfermode.h" |
| 13 | 13 |
| 14 class SkXfermode; | 14 class SkXfermode; |
| 15 | 15 |
| 16 /** DEPRECATED - use SkXfermode::Mode instead | |
| 17 */ | |
| 18 class SK_API SkPorterDuff { | 16 class SK_API SkPorterDuff { |
| 19 public: | 17 public: |
| 20 /** List of predefined xfermodes. In general, the algebra for the modes | 18 /** List of predefined xfermodes. In general, the algebra for the modes |
| 21 uses the following symbols: | 19 uses the following symbols: |
| 22 Sa, Sc - source alpha and color | 20 Sa, Sc - source alpha and color |
| 23 Da, Dc - destination alpha and color (before compositing) | 21 Da, Dc - destination alpha and color (before compositing) |
| 24 [a, c] - Resulting (alpha, color) values | 22 [a, c] - Resulting (alpha, color) values |
| 25 For these equations, the colors are in premultiplied state. | 23 For these equations, the colors are in premultiplied state. |
| 26 If no xfermode is specified, kSrcOver is assumed. | 24 If no xfermode is specified, kSrcOver is assumed. |
| 27 */ | 25 */ |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 /** If the specified xfermode advertises itself as one of the porterduff | 67 /** If the specified xfermode advertises itself as one of the porterduff |
| 70 modes (via SkXfermode::Coeff), return true and if not null, set mode | 68 modes (via SkXfermode::Coeff), return true and if not null, set mode |
| 71 to the corresponding porterduff mode. If it is not recognized as a one, | 69 to the corresponding porterduff mode. If it is not recognized as a one, |
| 72 return false and ignore the mode parameter. | 70 return false and ignore the mode parameter. |
| 73 */ | 71 */ |
| 74 static bool IsMode(SkXfermode*, Mode* mode); | 72 static bool IsMode(SkXfermode*, Mode* mode); |
| 75 | 73 |
| 76 /** Return the corersponding SkXfermode::Mode | 74 /** Return the corersponding SkXfermode::Mode |
| 77 */ | 75 */ |
| 78 static SkXfermode::Mode ToXfermodeMode(Mode); | 76 static SkXfermode::Mode ToXfermodeMode(Mode); |
| 79 }; | 77 } SK_ATTR_DEPRECATED("use SkXfermode::Mode"); |
| 80 | 78 |
| 81 #endif | 79 #endif |
| OLD | NEW |