OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
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 SkSwizzler_DEFINED | 8 #ifndef SkSwizzler_DEFINED |
9 #define SkSwizzler_DEFINED | 9 #define SkSwizzler_DEFINED |
10 | 10 |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 * whether colorTable is NULL: | 148 * whether colorTable is NULL: |
149 * | 149 * |
150 * A NULL colorTable means colorOrIndex is treated as an SkPMColor (premul o
r | 150 * A NULL colorTable means colorOrIndex is treated as an SkPMColor (premul o
r |
151 * unpremul, depending on dstInfo.alphaType()). Each 4-byte pixel will be se
t to | 151 * unpremul, depending on dstInfo.alphaType()). Each 4-byte pixel will be se
t to |
152 * colorOrIndex. | 152 * colorOrIndex. |
153 | 153 |
154 * A non-NULL colorTable means colorOrIndex is treated as a uint8_t index in
to | 154 * A non-NULL colorTable means colorOrIndex is treated as a uint8_t index in
to |
155 * the colorTable. i.e. each 4-byte pixel will be set to | 155 * the colorTable. i.e. each 4-byte pixel will be set to |
156 * colorTable[(uint8_t) colorOrIndex]. | 156 * colorTable[(uint8_t) colorOrIndex]. |
157 * | 157 * |
| 158 * If dstInfo.colorType() is kGray, colorOrIndex is always treated as an 8-b
it color. |
| 159 * |
158 * Other SkColorTypes are not supported. | 160 * Other SkColorTypes are not supported. |
159 * | 161 * |
160 */ | 162 */ |
161 static void Fill(void* dstStartRow, const SkImageInfo& dstInfo, size_t dstRo
wBytes, | 163 static void Fill(void* dstStartRow, const SkImageInfo& dstInfo, size_t dstRo
wBytes, |
162 uint32_t numRows, uint32_t colorOrIndex, const SkPMColor* colorTable
); | 164 uint32_t numRows, uint32_t colorOrIndex, const SkPMColor* colorTable
); |
163 | 165 |
164 /** | 166 /** |
165 * Swizzle the next line. Call height times, once for each row of source. | 167 * Swizzle the next line. Call height times, once for each row of source. |
166 * @param src The next row of the source data. | 168 * @param src The next row of the source data. |
167 * @return A result code describing if the row was fully opaque, fully | 169 * @return A result code describing if the row was fully opaque, fully |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 const SkImageInfo fDstInfo; | 244 const SkImageInfo fDstInfo; |
243 void* fDstRow; | 245 void* fDstRow; |
244 const size_t fDstRowBytes; | 246 const size_t fDstRowBytes; |
245 int fCurrY; | 247 int fCurrY; |
246 | 248 |
247 SkSwizzler(RowProc proc, const SkPMColor* ctable, int deltaSrc, | 249 SkSwizzler(RowProc proc, const SkPMColor* ctable, int deltaSrc, |
248 const SkImageInfo& info, void* dst, size_t rowBytes); | 250 const SkImageInfo& info, void* dst, size_t rowBytes); |
249 | 251 |
250 }; | 252 }; |
251 #endif // SkSwizzler_DEFINED | 253 #endif // SkSwizzler_DEFINED |
OLD | NEW |