| 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 | 115 |
| 116 /** Construct a colorfilter whose effect is to first apply the inner filter
and then apply | 116 /** Construct a colorfilter whose effect is to first apply the inner filter
and then apply |
| 117 * the outer filter to the result of the inner's. | 117 * the outer filter to the result of the inner's. |
| 118 * The reference counts for outer and inner are incremented. | 118 * The reference counts for outer and inner are incremented. |
| 119 * | 119 * |
| 120 * Due to internal limits, it is possible that this will return NULL, so th
e caller must | 120 * Due to internal limits, it is possible that this will return NULL, so th
e caller must |
| 121 * always check. | 121 * always check. |
| 122 */ | 122 */ |
| 123 static SkColorFilter* CreateComposeFilter(SkColorFilter* outer, SkColorFilte
r* inner); | 123 static SkColorFilter* CreateComposeFilter(SkColorFilter* outer, SkColorFilte
r* inner); |
| 124 | 124 |
| 125 /** Construct a color filter that transforms a color by a 4x5 matrix. The ma
trix is in row- |
| 126 * major order and the translation column is specified in unnormalized, 0..
.255, space. |
| 127 */ |
| 128 static SkColorFilter* CreateMatrixFilterRowMajor255(const SkScalar array[20]
); |
| 129 |
| 125 /** | 130 /** |
| 126 * A subclass may implement this factory function to work with the GPU back
end. It returns | 131 * A subclass may implement this factory function to work with the GPU back
end. It returns |
| 127 * a GrFragmentProcessor that implemets the color filter in GPU shader code
. | 132 * a GrFragmentProcessor that implemets the color filter in GPU shader code
. |
| 128 * | 133 * |
| 129 * The fragment processor receives a premultiplied input color and produces
a premultiplied | 134 * The fragment processor receives a premultiplied input color and produces
a premultiplied |
| 130 * output color. | 135 * output color. |
| 131 * | 136 * |
| 132 * A null return indicates that the color filter isn't implemented for the
GPU backend. | 137 * A null return indicates that the color filter isn't implemented for the
GPU backend. |
| 133 */ | 138 */ |
| 134 virtual const GrFragmentProcessor* asFragmentProcessor(GrContext*) const { | 139 virtual const GrFragmentProcessor* asFragmentProcessor(GrContext*) const { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 155 * | 160 * |
| 156 * e.g. compose(filter, compose(compose(filter, filter), filter)) --> 4 | 161 * e.g. compose(filter, compose(compose(filter, filter), filter)) --> 4 |
| 157 */ | 162 */ |
| 158 virtual int privateComposedFilterCount() const { return 1; } | 163 virtual int privateComposedFilterCount() const { return 1; } |
| 159 friend class SkComposeColorFilter; | 164 friend class SkComposeColorFilter; |
| 160 | 165 |
| 161 typedef SkFlattenable INHERITED; | 166 typedef SkFlattenable INHERITED; |
| 162 }; | 167 }; |
| 163 | 168 |
| 164 #endif | 169 #endif |
| OLD | NEW |