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 SkColorFilter_DEFINED | 10 #ifndef SkColorFilter_DEFINED |
11 #define SkColorFilter_DEFINED | 11 #define SkColorFilter_DEFINED |
12 | 12 |
13 #include "SkColor.h" | 13 #include "SkColor.h" |
14 #include "SkFlattenable.h" | 14 #include "SkFlattenable.h" |
15 #include "SkXfermode.h" | 15 #include "SkXfermode.h" |
16 | 16 |
17 class SkBitmap; | 17 class SkBitmap; |
18 class GrEffectRef; | 18 class GrEffect; |
19 class GrContext; | 19 class GrContext; |
20 | 20 |
21 /** | 21 /** |
22 * ColorFilters are optional objects in the drawing pipeline. When present in | 22 * ColorFilters are optional objects in the drawing pipeline. When present in |
23 * a paint, they are called with the "src" colors, and return new colors, which | 23 * a paint, they are called with the "src" colors, and return new colors, which |
24 * are then passed onto the next stage (either ImageFilter or Xfermode). | 24 * are then passed onto the next stage (either ImageFilter or Xfermode). |
25 * | 25 * |
26 * All subclasses are required to be reentrant-safe : it must be legal to share | 26 * All subclasses are required to be reentrant-safe : it must be legal to share |
27 * the same instance between several threads. | 27 * the same instance between several threads. |
28 */ | 28 */ |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 /** Create a colorfilter that multiplies the RGB channels by one color, and | 119 /** Create a colorfilter that multiplies the RGB channels by one color, and |
120 then adds a second color, pinning the result for each component to | 120 then adds a second color, pinning the result for each component to |
121 [0..255]. The alpha components of the mul and add arguments | 121 [0..255]. The alpha components of the mul and add arguments |
122 are ignored. | 122 are ignored. |
123 */ | 123 */ |
124 static SkColorFilter* CreateLightingFilter(SkColor mul, SkColor add); | 124 static SkColorFilter* CreateLightingFilter(SkColor mul, SkColor add); |
125 | 125 |
126 /** A subclass may implement this factory function to work with the GPU back
end. If the return | 126 /** A subclass may implement this factory function to work with the GPU back
end. If the return |
127 is non-NULL then the caller owns a ref on the returned object. | 127 is non-NULL then the caller owns a ref on the returned object. |
128 */ | 128 */ |
129 virtual GrEffectRef* asNewEffect(GrContext*) const; | 129 virtual GrEffect* asNewEffect(GrContext*) const; |
130 | 130 |
131 SK_TO_STRING_PUREVIRT() | 131 SK_TO_STRING_PUREVIRT() |
132 | 132 |
133 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() | 133 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() |
134 SK_DEFINE_FLATTENABLE_TYPE(SkColorFilter) | 134 SK_DEFINE_FLATTENABLE_TYPE(SkColorFilter) |
135 | 135 |
136 protected: | 136 protected: |
137 SkColorFilter() {} | 137 SkColorFilter() {} |
138 SkColorFilter(SkReadBuffer& rb) : INHERITED(rb) {} | 138 SkColorFilter(SkReadBuffer& rb) : INHERITED(rb) {} |
139 | 139 |
140 private: | 140 private: |
141 typedef SkFlattenable INHERITED; | 141 typedef SkFlattenable INHERITED; |
142 }; | 142 }; |
143 | 143 |
144 #endif | 144 #endif |
OLD | NEW |