Chromium Code Reviews| 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 147 * A NULL colorTable means colorOrIndex is treated as an SkPMColor (premul o r | 147 * A NULL colorTable means colorOrIndex is treated as an SkPMColor (premul o r |
| 148 * unpremul, depending on dstInfo.alphaType()). Each 4-byte pixel will be se t to | 148 * unpremul, depending on dstInfo.alphaType()). Each 4-byte pixel will be se t to |
| 149 * colorOrIndex. | 149 * colorOrIndex. |
| 150 | 150 |
| 151 * A non-NULL colorTable means colorOrIndex is treated as a uint8_t index in to | 151 * A non-NULL colorTable means colorOrIndex is treated as a uint8_t index in to |
| 152 * the colorTable. i.e. each 4-byte pixel will be set to | 152 * the colorTable. i.e. each 4-byte pixel will be set to |
| 153 * colorTable[(uint8_t) colorOrIndex]. | 153 * colorTable[(uint8_t) colorOrIndex]. |
| 154 * | 154 * |
| 155 * Other SkColorTypes are not supported. | 155 * Other SkColorTypes are not supported. |
| 156 * | 156 * |
| 157 * @param bottomUp | |
| 158 * If true, this indicates that stream contains rows of the image starting f rom the | |
| 159 * bottom. The rows that need to be filled will be the top rows. | |
| 160 * | |
| 157 */ | 161 */ |
| 158 static void Fill(void* dst, const SkImageInfo& dstInfo, size_t dstRowBytes, uint32_t y, | 162 static void Fill(void* dst, const SkImageInfo& dstInfo, size_t dstRowBytes, uint32_t y, |
| 159 uint32_t colorOrIndex, SkPMColor* colorTable); | 163 uint32_t colorOrIndex, const SkPMColor* colorTable, bool bottomUp = false); |
|
scroggo
2015/04/10 18:12:43
I think it would be better to use RowOrder (which
msarett
2015/04/10 20:52:56
A new design will take care of this. We will now
| |
| 160 | 164 |
| 161 /** | 165 /** |
| 162 * Swizzle the next line. Call height times, once for each row of source. | 166 * Swizzle the next line. Call height times, once for each row of source. |
| 163 * @param src The next row of the source data. | 167 * @param src The next row of the source data. |
| 164 * @return A result code describing if the row was fully opaque, fully | 168 * @return A result code describing if the row was fully opaque, fully |
| 165 * transparent, or neither | 169 * transparent, or neither |
| 166 */ | 170 */ |
| 167 ResultAlpha next(const uint8_t* SK_RESTRICT src); | 171 ResultAlpha next(const uint8_t* SK_RESTRICT src); |
| 168 | 172 |
| 169 /** | 173 /** |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 228 const SkImageInfo fDstInfo; | 232 const SkImageInfo fDstInfo; |
| 229 void* fDstRow; | 233 void* fDstRow; |
| 230 const size_t fDstRowBytes; | 234 const size_t fDstRowBytes; |
| 231 int fCurrY; | 235 int fCurrY; |
| 232 | 236 |
| 233 SkSwizzler(RowProc proc, const SkPMColor* ctable, int deltaSrc, | 237 SkSwizzler(RowProc proc, const SkPMColor* ctable, int deltaSrc, |
| 234 const SkImageInfo& info, void* dst, size_t rowBytes); | 238 const SkImageInfo& info, void* dst, size_t rowBytes); |
| 235 | 239 |
| 236 }; | 240 }; |
| 237 #endif // SkSwizzler_DEFINED | 241 #endif // SkSwizzler_DEFINED |
| OLD | NEW |