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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 */ | 137 */ |
138 static SkColorFilter* CreateComposeFilter(SkColorFilter* outer, SkColorFilte
r* inner); | 138 static SkColorFilter* CreateComposeFilter(SkColorFilter* outer, SkColorFilte
r* inner); |
139 | 139 |
140 /** | 140 /** |
141 * A subclass may implement this factory function to work with the GPU back
end. | 141 * A subclass may implement this factory function to work with the GPU back
end. |
142 * If it returns true, then 1 or more fragment processors will have been ap
pended to the | 142 * If it returns true, then 1 or more fragment processors will have been ap
pended to the |
143 * array, each of which has been ref'd, so that the caller is responsible f
or calling unref() | 143 * array, each of which has been ref'd, so that the caller is responsible f
or calling unref() |
144 * on them when they are finished. If more than one processor is appended,
they will be | 144 * on them when they are finished. If more than one processor is appended,
they will be |
145 * applied in FIFO order. | 145 * applied in FIFO order. |
146 * | 146 * |
| 147 * The fragment processor(s) must each return their color as a premul norma
lized value |
| 148 * e.g. each component between [0..1] and each color component <= alpha. |
| 149 * |
147 * If the subclass returns false, then it should not modify the array at al
l. | 150 * If the subclass returns false, then it should not modify the array at al
l. |
148 */ | 151 */ |
149 virtual bool asFragmentProcessors(GrContext*, SkTDArray<GrFragmentProcessor*
>*) const { | 152 virtual bool asFragmentProcessors(GrContext*, SkTDArray<GrFragmentProcessor*
>*) const { |
150 return false; | 153 return false; |
151 } | 154 } |
152 | 155 |
153 SK_TO_STRING_PUREVIRT() | 156 SK_TO_STRING_PUREVIRT() |
154 | 157 |
155 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() | 158 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() |
156 SK_DEFINE_FLATTENABLE_TYPE(SkColorFilter) | 159 SK_DEFINE_FLATTENABLE_TYPE(SkColorFilter) |
157 | 160 |
158 protected: | 161 protected: |
159 SkColorFilter() {} | 162 SkColorFilter() {} |
160 | 163 |
161 private: | 164 private: |
162 typedef SkFlattenable INHERITED; | 165 typedef SkFlattenable INHERITED; |
163 }; | 166 }; |
164 | 167 |
165 #endif | 168 #endif |
OLD | NEW |