| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 */ | 61 */ |
| 62 virtual bool asComponentTable(SkBitmap* table) const; | 62 virtual bool asComponentTable(SkBitmap* table) const; |
| 63 | 63 |
| 64 /** Called with a scanline of colors, as if there was a shader installed. | 64 /** Called with a scanline of colors, as if there was a shader installed. |
| 65 The implementation writes out its filtered version into result[]. | 65 The implementation writes out its filtered version into result[]. |
| 66 Note: shader and result may be the same buffer. | 66 Note: shader and result may be the same buffer. |
| 67 @param src array of colors, possibly generated by a shader | 67 @param src array of colors, possibly generated by a shader |
| 68 @param count the number of entries in the src[] and result[] arrays | 68 @param count the number of entries in the src[] and result[] arrays |
| 69 @param result written by the filter | 69 @param result written by the filter |
| 70 */ | 70 */ |
| 71 virtual void filterSpan(const SkPMColor src[], int count, SkPMColor result[]
) const = 0; | 71 virtual void filterSpan(const SkPMColor src[], int count, |
| 72 SkPMColor result[]) const = 0; |
| 73 /** Called with a scanline of colors, as if there was a shader installed. |
| 74 The implementation writes out its filtered version into result[]. |
| 75 Note: shader and result may be the same buffer. |
| 76 @param src array of colors, possibly generated by a shader |
| 77 @param count the number of entries in the src[] and result[] arrays |
| 78 @param result written by the filter |
| 79 */ |
| 80 virtual void filterSpan16(const uint16_t shader[], int count, |
| 81 uint16_t result[]) const; |
| 72 | 82 |
| 73 enum Flags { | 83 enum Flags { |
| 74 /** If set the filter methods will not change the alpha channel of the c
olors. | 84 /** If set the filter methods will not change the alpha channel of the |
| 85 colors. |
| 75 */ | 86 */ |
| 76 kAlphaUnchanged_Flag = 0x01, | 87 kAlphaUnchanged_Flag = 0x01, |
| 88 /** If set, this subclass implements filterSpan16(). If this flag is |
| 89 set, then kAlphaUnchanged_Flag must also be set. |
| 90 */ |
| 91 kHasFilter16_Flag = 0x02 |
| 77 }; | 92 }; |
| 78 | 93 |
| 79 /** Returns the flags for this filter. Override in subclasses to return cust
om flags. | 94 /** Returns the flags for this filter. Override in subclasses to return |
| 95 custom flags. |
| 80 */ | 96 */ |
| 81 virtual uint32_t getFlags() const { return 0; } | 97 virtual uint32_t getFlags() const { return 0; } |
| 82 | 98 |
| 83 /** | 99 /** |
| 84 * If this subclass can optimally createa composition with the inner filter
, return it as | 100 * If this subclass can optimally createa composition with the inner filter
, return it as |
| 85 * a new filter (which the caller must unref() when it is done). If no such
optimization | 101 * a new filter (which the caller must unref() when it is done). If no such
optimization |
| 86 * is known, return NULL. | 102 * is known, return NULL. |
| 87 * | 103 * |
| 88 * e.g. result(color) == this_filter(inner(color)) | 104 * e.g. result(color) == this_filter(inner(color)) |
| 89 */ | 105 */ |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 * | 172 * |
| 157 * e.g. compose(filter, compose(compose(filter, filter), filter)) --> 4 | 173 * e.g. compose(filter, compose(compose(filter, filter), filter)) --> 4 |
| 158 */ | 174 */ |
| 159 virtual int privateComposedFilterCount() const { return 1; } | 175 virtual int privateComposedFilterCount() const { return 1; } |
| 160 friend class SkComposeColorFilter; | 176 friend class SkComposeColorFilter; |
| 161 | 177 |
| 162 typedef SkFlattenable INHERITED; | 178 typedef SkFlattenable INHERITED; |
| 163 }; | 179 }; |
| 164 | 180 |
| 165 #endif | 181 #endif |
| OLD | NEW |