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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 return nullptr; | 155 return nullptr; |
156 } | 156 } |
157 | 157 |
158 bool affectsTransparentBlack() const { | 158 bool affectsTransparentBlack() const { |
159 return this->filterColor(0) != 0; | 159 return this->filterColor(0) != 0; |
160 } | 160 } |
161 | 161 |
162 SK_TO_STRING_PUREVIRT() | 162 SK_TO_STRING_PUREVIRT() |
163 | 163 |
164 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() | 164 SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() |
| 165 SK_DEFINE_FLATTENABLE_TYPE(SkColorFilter) |
165 | 166 |
166 protected: | 167 protected: |
167 SkColorFilter() {} | 168 SkColorFilter() {} |
168 | 169 |
169 private: | 170 private: |
170 /* | 171 /* |
171 * Returns 1 if this is a single filter (not a composition of other filters
), otherwise it | 172 * Returns 1 if this is a single filter (not a composition of other filters
), otherwise it |
172 * reutrns the number of leaf-node filters in a composition. This should be
the same value | 173 * reutrns the number of leaf-node filters in a composition. This should be
the same value |
173 * as the number of GrFragmentProcessors returned by asFragmentProcessors's
array parameter. | 174 * as the number of GrFragmentProcessors returned by asFragmentProcessors's
array parameter. |
174 * | 175 * |
175 * e.g. compose(filter, compose(compose(filter, filter), filter)) --> 4 | 176 * e.g. compose(filter, compose(compose(filter, filter), filter)) --> 4 |
176 */ | 177 */ |
177 virtual int privateComposedFilterCount() const { return 1; } | 178 virtual int privateComposedFilterCount() const { return 1; } |
178 friend class SkComposeColorFilter; | 179 friend class SkComposeColorFilter; |
179 | 180 |
180 typedef SkFlattenable INHERITED; | 181 typedef SkFlattenable INHERITED; |
181 }; | 182 }; |
182 | 183 |
183 #endif | 184 #endif |
OLD | NEW |