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 SkColorFilter_DEFINED | 8 #ifndef SkColorFilter_DEFINED |
9 #define SkColorFilter_DEFINED | 9 #define SkColorFilter_DEFINED |
10 | 10 |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 /** Create a colorfilter that uses the specified color and mode. | 108 /** Create a colorfilter that uses the specified color and mode. |
109 If the Mode is DST, this function will return NULL (since that | 109 If the Mode is DST, this function will return NULL (since that |
110 mode will have no effect on the result). | 110 mode will have no effect on the result). |
111 @param c The source color used with the specified mode | 111 @param c The source color used with the specified mode |
112 @param mode The xfermode mode that is applied to each color in | 112 @param mode The xfermode mode that is applied to each color in |
113 the colorfilter's filterSpan[16,32] methods | 113 the colorfilter's filterSpan[16,32] methods |
114 @return colorfilter object that applies the src color and mode, | 114 @return colorfilter object that applies the src color and mode, |
115 or NULL if the mode will have no effect. | 115 or NULL if the mode will have no effect. |
116 */ | 116 */ |
117 static sk_sp<SkColorFilter> MakeModeFilter(SkColor c, SkXfermode::Mode mode)
; | 117 static sk_sp<SkColorFilter> MakeModeFilter(SkColor c, SkXfermode::Mode mode)
; |
| 118 static sk_sp<SkColorFilter> MakeModeFilter(SkColor c, SkBlendMode mode) { |
| 119 return MakeModeFilter(c, (SkXfermode::Mode)mode); |
| 120 } |
118 | 121 |
119 /** Construct a colorfilter whose effect is to first apply the inner filter
and then apply | 122 /** Construct a colorfilter whose effect is to first apply the inner filter
and then apply |
120 * the outer filter to the result of the inner's. | 123 * the outer filter to the result of the inner's. |
121 * The reference counts for outer and inner are incremented. | 124 * The reference counts for outer and inner are incremented. |
122 * | 125 * |
123 * Due to internal limits, it is possible that this will return NULL, so th
e caller must | 126 * Due to internal limits, it is possible that this will return NULL, so th
e caller must |
124 * always check. | 127 * always check. |
125 */ | 128 */ |
126 static sk_sp<SkColorFilter> MakeComposeFilter(sk_sp<SkColorFilter> outer, | 129 static sk_sp<SkColorFilter> MakeComposeFilter(sk_sp<SkColorFilter> outer, |
127 sk_sp<SkColorFilter> inner); | 130 sk_sp<SkColorFilter> inner); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 * | 184 * |
182 * e.g. compose(filter, compose(compose(filter, filter), filter)) --> 4 | 185 * e.g. compose(filter, compose(compose(filter, filter), filter)) --> 4 |
183 */ | 186 */ |
184 virtual int privateComposedFilterCount() const { return 1; } | 187 virtual int privateComposedFilterCount() const { return 1; } |
185 friend class SkComposeColorFilter; | 188 friend class SkComposeColorFilter; |
186 | 189 |
187 typedef SkFlattenable INHERITED; | 190 typedef SkFlattenable INHERITED; |
188 }; | 191 }; |
189 | 192 |
190 #endif | 193 #endif |
OLD | NEW |