Flutter Engine
The Flutter Engine
Functions
SkMaskSwizzler.cpp File Reference
#include "src/codec/SkMaskSwizzler.h"
#include "include/core/SkAlphaType.h"
#include "include/core/SkColor.h"
#include "include/core/SkColorType.h"
#include "include/core/SkImageInfo.h"
#include "include/core/SkRect.h"
#include "include/private/SkColorData.h"
#include "src/codec/SkCodecPriv.h"
#include "src/core/SkMasks.h"

Go to the source code of this file.

Functions

static void swizzle_mask16_to_rgba_opaque (void *dstRow, const uint8_t *srcRow, int width, SkMasks *masks, uint32_t startX, uint32_t sampleX)
 
static void swizzle_mask16_to_bgra_opaque (void *dstRow, const uint8_t *srcRow, int width, SkMasks *masks, uint32_t startX, uint32_t sampleX)
 
static void swizzle_mask16_to_rgba_unpremul (void *dstRow, const uint8_t *srcRow, int width, SkMasks *masks, uint32_t startX, uint32_t sampleX)
 
static void swizzle_mask16_to_bgra_unpremul (void *dstRow, const uint8_t *srcRow, int width, SkMasks *masks, uint32_t startX, uint32_t sampleX)
 
static void swizzle_mask16_to_rgba_premul (void *dstRow, const uint8_t *srcRow, int width, SkMasks *masks, uint32_t startX, uint32_t sampleX)
 
static void swizzle_mask16_to_bgra_premul (void *dstRow, const uint8_t *srcRow, int width, SkMasks *masks, uint32_t startX, uint32_t sampleX)
 
static void swizzle_mask16_to_565 (void *dstRow, const uint8_t *srcRow, int width, SkMasks *masks, uint32_t startX, uint32_t sampleX)
 
static void swizzle_mask24_to_rgba_opaque (void *dstRow, const uint8_t *srcRow, int width, SkMasks *masks, uint32_t startX, uint32_t sampleX)
 
static void swizzle_mask24_to_bgra_opaque (void *dstRow, const uint8_t *srcRow, int width, SkMasks *masks, uint32_t startX, uint32_t sampleX)
 
static void swizzle_mask24_to_rgba_unpremul (void *dstRow, const uint8_t *srcRow, int width, SkMasks *masks, uint32_t startX, uint32_t sampleX)
 
static void swizzle_mask24_to_bgra_unpremul (void *dstRow, const uint8_t *srcRow, int width, SkMasks *masks, uint32_t startX, uint32_t sampleX)
 
static void swizzle_mask24_to_rgba_premul (void *dstRow, const uint8_t *srcRow, int width, SkMasks *masks, uint32_t startX, uint32_t sampleX)
 
static void swizzle_mask24_to_bgra_premul (void *dstRow, const uint8_t *srcRow, int width, SkMasks *masks, uint32_t startX, uint32_t sampleX)
 
static void swizzle_mask24_to_565 (void *dstRow, const uint8_t *srcRow, int width, SkMasks *masks, uint32_t startX, uint32_t sampleX)
 
static void swizzle_mask32_to_rgba_opaque (void *dstRow, const uint8_t *srcRow, int width, SkMasks *masks, uint32_t startX, uint32_t sampleX)
 
static void swizzle_mask32_to_bgra_opaque (void *dstRow, const uint8_t *srcRow, int width, SkMasks *masks, uint32_t startX, uint32_t sampleX)
 
static void swizzle_mask32_to_rgba_unpremul (void *dstRow, const uint8_t *srcRow, int width, SkMasks *masks, uint32_t startX, uint32_t sampleX)
 
static void swizzle_mask32_to_bgra_unpremul (void *dstRow, const uint8_t *srcRow, int width, SkMasks *masks, uint32_t startX, uint32_t sampleX)
 
static void swizzle_mask32_to_rgba_premul (void *dstRow, const uint8_t *srcRow, int width, SkMasks *masks, uint32_t startX, uint32_t sampleX)
 
static void swizzle_mask32_to_bgra_premul (void *dstRow, const uint8_t *srcRow, int width, SkMasks *masks, uint32_t startX, uint32_t sampleX)
 
static void swizzle_mask32_to_565 (void *dstRow, const uint8_t *srcRow, int width, SkMasks *masks, uint32_t startX, uint32_t sampleX)
 

Function Documentation

◆ swizzle_mask16_to_565()

static void swizzle_mask16_to_565 ( void *  dstRow,
const uint8_t *  srcRow,
int  width,
SkMasks masks,
uint32_t  startX,
uint32_t  sampleX 
)
static

Definition at line 127 of file SkMaskSwizzler.cpp.

129 {
130
131 // Use the masks to decode to the destination
132 const uint16_t* srcPtr = ((const uint16_t*) srcRow) + startX;
133 uint16_t* dstPtr = (uint16_t*) dstRow;
134 for (int i = 0; i < width; i++) {
135 uint16_t p = srcPtr[0];
136 uint8_t red = masks->getRed(p);
137 uint8_t green = masks->getGreen(p);
138 uint8_t blue = masks->getBlue(p);
139 dstPtr[i] = SkPack888ToRGB16(red, green, blue);
140 srcPtr += sampleX;
141 }
142}
static U16CPU SkPack888ToRGB16(U8CPU r, U8CPU g, U8CPU b)
Definition: SkColorData.h:324
uint8_t getBlue(uint32_t pixel) const
Definition: SkMasks.cpp:76
uint8_t getGreen(uint32_t pixel) const
Definition: SkMasks.cpp:73
uint8_t getRed(uint32_t pixel) const
Definition: SkMasks.cpp:70
int32_t width

◆ swizzle_mask16_to_bgra_opaque()

static void swizzle_mask16_to_bgra_opaque ( void *  dstRow,
const uint8_t *  srcRow,
int  width,
SkMasks masks,
uint32_t  startX,
uint32_t  sampleX 
)
static

Definition at line 36 of file SkMaskSwizzler.cpp.

38 {
39
40 // Use the masks to decode to the destination
41 const uint16_t* srcPtr = ((const uint16_t*) srcRow) + startX;
42 SkPMColor* dstPtr = (SkPMColor*) dstRow;
43 for (int i = 0; i < width; i++) {
44 uint16_t p = srcPtr[0];
45 uint8_t red = masks->getRed(p);
46 uint8_t green = masks->getGreen(p);
47 uint8_t blue = masks->getBlue(p);
48 dstPtr[i] = SkPackARGB_as_BGRA(0xFF, red, green, blue);
49 srcPtr += sampleX;
50 }
51}
static uint32_t SkPackARGB_as_BGRA(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
Definition: SkColorData.h:74
uint32_t SkPMColor
Definition: SkColor.h:205

◆ swizzle_mask16_to_bgra_premul()

static void swizzle_mask16_to_bgra_premul ( void *  dstRow,
const uint8_t *  srcRow,
int  width,
SkMasks masks,
uint32_t  startX,
uint32_t  sampleX 
)
static

Definition at line 107 of file SkMaskSwizzler.cpp.

109 {
110
111 // Use the masks to decode to the destination
112 const uint16_t* srcPtr = ((const uint16_t*) srcRow) + startX;
113 SkPMColor* dstPtr = (SkPMColor*) dstRow;
114 for (int i = 0; i < width; i++) {
115 uint16_t p = srcPtr[0];
116 uint8_t red = masks->getRed(p);
117 uint8_t green = masks->getGreen(p);
118 uint8_t blue = masks->getBlue(p);
119 uint8_t alpha = masks->getAlpha(p);
120 dstPtr[i] = premultiply_argb_as_bgra(alpha, red, green, blue);
121 srcPtr += sampleX;
122 }
123}
static SkPMColor premultiply_argb_as_bgra(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
Definition: SkCodecPriv.h:220
uint8_t getAlpha(uint32_t pixel) const
Definition: SkMasks.cpp:79

◆ swizzle_mask16_to_bgra_unpremul()

static void swizzle_mask16_to_bgra_unpremul ( void *  dstRow,
const uint8_t *  srcRow,
int  width,
SkMasks masks,
uint32_t  startX,
uint32_t  sampleX 
)
static

Definition at line 71 of file SkMaskSwizzler.cpp.

73 {
74
75 // Use the masks to decode to the destination
76 const uint16_t* srcPtr = ((const uint16_t*) srcRow) + startX;
77 SkPMColor* dstPtr = (SkPMColor*) dstRow;
78 for (int i = 0; i < width; i++) {
79 uint16_t p = srcPtr[0];
80 uint8_t red = masks->getRed(p);
81 uint8_t green = masks->getGreen(p);
82 uint8_t blue = masks->getBlue(p);
83 uint8_t alpha = masks->getAlpha(p);
84 dstPtr[i] = SkPackARGB_as_BGRA(alpha, red, green, blue);
85 srcPtr += sampleX;
86 }
87}

◆ swizzle_mask16_to_rgba_opaque()

static void swizzle_mask16_to_rgba_opaque ( void *  dstRow,
const uint8_t *  srcRow,
int  width,
SkMasks masks,
uint32_t  startX,
uint32_t  sampleX 
)
static

Definition at line 19 of file SkMaskSwizzler.cpp.

21 {
22
23 // Use the masks to decode to the destination
24 const uint16_t* srcPtr = ((const uint16_t*) srcRow) + startX;
25 SkPMColor* dstPtr = (SkPMColor*) dstRow;
26 for (int i = 0; i < width; i++) {
27 uint16_t p = srcPtr[0];
28 uint8_t red = masks->getRed(p);
29 uint8_t green = masks->getGreen(p);
30 uint8_t blue = masks->getBlue(p);
31 dstPtr[i] = SkPackARGB_as_RGBA(0xFF, red, green, blue);
32 srcPtr += sampleX;
33 }
34}
static uint32_t SkPackARGB_as_RGBA(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
Definition: SkColorData.h:65

◆ swizzle_mask16_to_rgba_premul()

static void swizzle_mask16_to_rgba_premul ( void *  dstRow,
const uint8_t *  srcRow,
int  width,
SkMasks masks,
uint32_t  startX,
uint32_t  sampleX 
)
static

Definition at line 89 of file SkMaskSwizzler.cpp.

91 {
92
93 // Use the masks to decode to the destination
94 const uint16_t* srcPtr = ((const uint16_t*) srcRow) + startX;
95 SkPMColor* dstPtr = (SkPMColor*) dstRow;
96 for (int i = 0; i < width; i++) {
97 uint16_t p = srcPtr[0];
98 uint8_t red = masks->getRed(p);
99 uint8_t green = masks->getGreen(p);
100 uint8_t blue = masks->getBlue(p);
101 uint8_t alpha = masks->getAlpha(p);
102 dstPtr[i] = premultiply_argb_as_rgba(alpha, red, green, blue);
103 srcPtr += sampleX;
104 }
105}
static SkPMColor premultiply_argb_as_rgba(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
Definition: SkCodecPriv.h:210

◆ swizzle_mask16_to_rgba_unpremul()

static void swizzle_mask16_to_rgba_unpremul ( void *  dstRow,
const uint8_t *  srcRow,
int  width,
SkMasks masks,
uint32_t  startX,
uint32_t  sampleX 
)
static

Definition at line 53 of file SkMaskSwizzler.cpp.

55 {
56
57 // Use the masks to decode to the destination
58 const uint16_t* srcPtr = ((const uint16_t*) srcRow) + startX;
59 SkPMColor* dstPtr = (SkPMColor*) dstRow;
60 for (int i = 0; i < width; i++) {
61 uint16_t p = srcPtr[0];
62 uint8_t red = masks->getRed(p);
63 uint8_t green = masks->getGreen(p);
64 uint8_t blue = masks->getBlue(p);
65 uint8_t alpha = masks->getAlpha(p);
66 dstPtr[i] = SkPackARGB_as_RGBA(alpha, red, green, blue);
67 srcPtr += sampleX;
68 }
69}

◆ swizzle_mask24_to_565()

static void swizzle_mask24_to_565 ( void *  dstRow,
const uint8_t *  srcRow,
int  width,
SkMasks masks,
uint32_t  startX,
uint32_t  sampleX 
)
static

Definition at line 250 of file SkMaskSwizzler.cpp.

252 {
253
254 // Use the masks to decode to the destination
255 srcRow += 3 * startX;
256 uint16_t* dstPtr = (uint16_t*) dstRow;
257 for (int i = 0; i < width; i++) {
258 uint32_t p = srcRow[0] | (srcRow[1] << 8) | srcRow[2] << 16;
259 uint8_t red = masks->getRed(p);
260 uint8_t green = masks->getGreen(p);
261 uint8_t blue = masks->getBlue(p);
262 dstPtr[i] = SkPack888ToRGB16(red, green, blue);
263 srcRow += 3 * sampleX;
264 }
265}

◆ swizzle_mask24_to_bgra_opaque()

static void swizzle_mask24_to_bgra_opaque ( void *  dstRow,
const uint8_t *  srcRow,
int  width,
SkMasks masks,
uint32_t  startX,
uint32_t  sampleX 
)
static

Definition at line 161 of file SkMaskSwizzler.cpp.

163 {
164
165 // Use the masks to decode to the destination
166 srcRow += 3 * startX;
167 SkPMColor* dstPtr = (SkPMColor*) dstRow;
168 for (int i = 0; i < width; i++) {
169 uint32_t p = srcRow[0] | (srcRow[1] << 8) | srcRow[2] << 16;
170 uint8_t red = masks->getRed(p);
171 uint8_t green = masks->getGreen(p);
172 uint8_t blue = masks->getBlue(p);
173 dstPtr[i] = SkPackARGB_as_BGRA(0xFF, red, green, blue);
174 srcRow += 3 * sampleX;
175 }
176}

◆ swizzle_mask24_to_bgra_premul()

static void swizzle_mask24_to_bgra_premul ( void *  dstRow,
const uint8_t *  srcRow,
int  width,
SkMasks masks,
uint32_t  startX,
uint32_t  sampleX 
)
static

Definition at line 232 of file SkMaskSwizzler.cpp.

234 {
235
236 // Use the masks to decode to the destination
237 srcRow += 3 * startX;
238 SkPMColor* dstPtr = (SkPMColor*) dstRow;
239 for (int i = 0; i < width; i++) {
240 uint32_t p = srcRow[0] | (srcRow[1] << 8) | srcRow[2] << 16;
241 uint8_t red = masks->getRed(p);
242 uint8_t green = masks->getGreen(p);
243 uint8_t blue = masks->getBlue(p);
244 uint8_t alpha = masks->getAlpha(p);
245 dstPtr[i] = premultiply_argb_as_bgra(alpha, red, green, blue);
246 srcRow += 3 * sampleX;
247 }
248}

◆ swizzle_mask24_to_bgra_unpremul()

static void swizzle_mask24_to_bgra_unpremul ( void *  dstRow,
const uint8_t *  srcRow,
int  width,
SkMasks masks,
uint32_t  startX,
uint32_t  sampleX 
)
static

Definition at line 196 of file SkMaskSwizzler.cpp.

198 {
199
200 // Use the masks to decode to the destination
201 srcRow += 3 * startX;
202 SkPMColor* dstPtr = (SkPMColor*) dstRow;
203 for (int i = 0; i < width; i++) {
204 uint32_t p = srcRow[0] | (srcRow[1] << 8) | srcRow[2] << 16;
205 uint8_t red = masks->getRed(p);
206 uint8_t green = masks->getGreen(p);
207 uint8_t blue = masks->getBlue(p);
208 uint8_t alpha = masks->getAlpha(p);
209 dstPtr[i] = SkPackARGB_as_BGRA(alpha, red, green, blue);
210 srcRow += 3 * sampleX;
211 }
212}

◆ swizzle_mask24_to_rgba_opaque()

static void swizzle_mask24_to_rgba_opaque ( void *  dstRow,
const uint8_t *  srcRow,
int  width,
SkMasks masks,
uint32_t  startX,
uint32_t  sampleX 
)
static

Definition at line 144 of file SkMaskSwizzler.cpp.

146 {
147
148 // Use the masks to decode to the destination
149 srcRow += 3 * startX;
150 SkPMColor* dstPtr = (SkPMColor*) dstRow;
151 for (int i = 0; i < width; i++) {
152 uint32_t p = srcRow[0] | (srcRow[1] << 8) | srcRow[2] << 16;
153 uint8_t red = masks->getRed(p);
154 uint8_t green = masks->getGreen(p);
155 uint8_t blue = masks->getBlue(p);
156 dstPtr[i] = SkPackARGB_as_RGBA(0xFF, red, green, blue);
157 srcRow += 3 * sampleX;
158 }
159}

◆ swizzle_mask24_to_rgba_premul()

static void swizzle_mask24_to_rgba_premul ( void *  dstRow,
const uint8_t *  srcRow,
int  width,
SkMasks masks,
uint32_t  startX,
uint32_t  sampleX 
)
static

Definition at line 214 of file SkMaskSwizzler.cpp.

216 {
217
218 // Use the masks to decode to the destination
219 srcRow += 3 * startX;
220 SkPMColor* dstPtr = (SkPMColor*) dstRow;
221 for (int i = 0; i < width; i++) {
222 uint32_t p = srcRow[0] | (srcRow[1] << 8) | srcRow[2] << 16;
223 uint8_t red = masks->getRed(p);
224 uint8_t green = masks->getGreen(p);
225 uint8_t blue = masks->getBlue(p);
226 uint8_t alpha = masks->getAlpha(p);
227 dstPtr[i] = premultiply_argb_as_rgba(alpha, red, green, blue);
228 srcRow += 3 * sampleX;
229 }
230}

◆ swizzle_mask24_to_rgba_unpremul()

static void swizzle_mask24_to_rgba_unpremul ( void *  dstRow,
const uint8_t *  srcRow,
int  width,
SkMasks masks,
uint32_t  startX,
uint32_t  sampleX 
)
static

Definition at line 178 of file SkMaskSwizzler.cpp.

180 {
181
182 // Use the masks to decode to the destination
183 srcRow += 3 * startX;
184 SkPMColor* dstPtr = (SkPMColor*) dstRow;
185 for (int i = 0; i < width; i++) {
186 uint32_t p = srcRow[0] | (srcRow[1] << 8) | srcRow[2] << 16;
187 uint8_t red = masks->getRed(p);
188 uint8_t green = masks->getGreen(p);
189 uint8_t blue = masks->getBlue(p);
190 uint8_t alpha = masks->getAlpha(p);
191 dstPtr[i] = SkPackARGB_as_RGBA(alpha, red, green, blue);
192 srcRow += 3 * sampleX;
193 }
194}

◆ swizzle_mask32_to_565()

static void swizzle_mask32_to_565 ( void *  dstRow,
const uint8_t *  srcRow,
int  width,
SkMasks masks,
uint32_t  startX,
uint32_t  sampleX 
)
static

Definition at line 373 of file SkMaskSwizzler.cpp.

375 {
376 // Use the masks to decode to the destination
377 const uint32_t* srcPtr = ((const uint32_t*) srcRow) + startX;
378 uint16_t* dstPtr = (uint16_t*) dstRow;
379 for (int i = 0; i < width; i++) {
380 uint32_t p = srcPtr[0];
381 uint8_t red = masks->getRed(p);
382 uint8_t green = masks->getGreen(p);
383 uint8_t blue = masks->getBlue(p);
384 dstPtr[i] = SkPack888ToRGB16(red, green, blue);
385 srcPtr += sampleX;
386 }
387}

◆ swizzle_mask32_to_bgra_opaque()

static void swizzle_mask32_to_bgra_opaque ( void *  dstRow,
const uint8_t *  srcRow,
int  width,
SkMasks masks,
uint32_t  startX,
uint32_t  sampleX 
)
static

Definition at line 284 of file SkMaskSwizzler.cpp.

286 {
287
288 // Use the masks to decode to the destination
289 const uint32_t* srcPtr = ((const uint32_t*) srcRow) + startX;
290 SkPMColor* dstPtr = (SkPMColor*) dstRow;
291 for (int i = 0; i < width; i++) {
292 uint32_t p = srcPtr[0];
293 uint8_t red = masks->getRed(p);
294 uint8_t green = masks->getGreen(p);
295 uint8_t blue = masks->getBlue(p);
296 dstPtr[i] = SkPackARGB_as_BGRA(0xFF, red, green, blue);
297 srcPtr += sampleX;
298 }
299}

◆ swizzle_mask32_to_bgra_premul()

static void swizzle_mask32_to_bgra_premul ( void *  dstRow,
const uint8_t *  srcRow,
int  width,
SkMasks masks,
uint32_t  startX,
uint32_t  sampleX 
)
static

Definition at line 355 of file SkMaskSwizzler.cpp.

357 {
358
359 // Use the masks to decode to the destination
360 const uint32_t* srcPtr = ((const uint32_t*) srcRow) + startX;
361 SkPMColor* dstPtr = (SkPMColor*) dstRow;
362 for (int i = 0; i < width; i++) {
363 uint32_t p = srcPtr[0];
364 uint8_t red = masks->getRed(p);
365 uint8_t green = masks->getGreen(p);
366 uint8_t blue = masks->getBlue(p);
367 uint8_t alpha = masks->getAlpha(p);
368 dstPtr[i] = premultiply_argb_as_bgra(alpha, red, green, blue);
369 srcPtr += sampleX;
370 }
371}

◆ swizzle_mask32_to_bgra_unpremul()

static void swizzle_mask32_to_bgra_unpremul ( void *  dstRow,
const uint8_t *  srcRow,
int  width,
SkMasks masks,
uint32_t  startX,
uint32_t  sampleX 
)
static

Definition at line 319 of file SkMaskSwizzler.cpp.

321 {
322
323 // Use the masks to decode to the destination
324 const uint32_t* srcPtr = ((const uint32_t*) srcRow) + startX;
325 SkPMColor* dstPtr = (SkPMColor*) dstRow;
326 for (int i = 0; i < width; i++) {
327 uint32_t p = srcPtr[0];
328 uint8_t red = masks->getRed(p);
329 uint8_t green = masks->getGreen(p);
330 uint8_t blue = masks->getBlue(p);
331 uint8_t alpha = masks->getAlpha(p);
332 dstPtr[i] = SkPackARGB_as_BGRA(alpha, red, green, blue);
333 srcPtr += sampleX;
334 }
335}

◆ swizzle_mask32_to_rgba_opaque()

static void swizzle_mask32_to_rgba_opaque ( void *  dstRow,
const uint8_t *  srcRow,
int  width,
SkMasks masks,
uint32_t  startX,
uint32_t  sampleX 
)
static

Definition at line 267 of file SkMaskSwizzler.cpp.

269 {
270
271 // Use the masks to decode to the destination
272 const uint32_t* srcPtr = ((const uint32_t*) srcRow) + startX;
273 SkPMColor* dstPtr = (SkPMColor*) dstRow;
274 for (int i = 0; i < width; i++) {
275 uint32_t p = srcPtr[0];
276 uint8_t red = masks->getRed(p);
277 uint8_t green = masks->getGreen(p);
278 uint8_t blue = masks->getBlue(p);
279 dstPtr[i] = SkPackARGB_as_RGBA(0xFF, red, green, blue);
280 srcPtr += sampleX;
281 }
282}

◆ swizzle_mask32_to_rgba_premul()

static void swizzle_mask32_to_rgba_premul ( void *  dstRow,
const uint8_t *  srcRow,
int  width,
SkMasks masks,
uint32_t  startX,
uint32_t  sampleX 
)
static

Definition at line 337 of file SkMaskSwizzler.cpp.

339 {
340
341 // Use the masks to decode to the destination
342 const uint32_t* srcPtr = ((const uint32_t*) srcRow) + startX;
343 SkPMColor* dstPtr = (SkPMColor*) dstRow;
344 for (int i = 0; i < width; i++) {
345 uint32_t p = srcPtr[0];
346 uint8_t red = masks->getRed(p);
347 uint8_t green = masks->getGreen(p);
348 uint8_t blue = masks->getBlue(p);
349 uint8_t alpha = masks->getAlpha(p);
350 dstPtr[i] = premultiply_argb_as_rgba(alpha, red, green, blue);
351 srcPtr += sampleX;
352 }
353}

◆ swizzle_mask32_to_rgba_unpremul()

static void swizzle_mask32_to_rgba_unpremul ( void *  dstRow,
const uint8_t *  srcRow,
int  width,
SkMasks masks,
uint32_t  startX,
uint32_t  sampleX 
)
static

Definition at line 301 of file SkMaskSwizzler.cpp.

303 {
304
305 // Use the masks to decode to the destination
306 const uint32_t* srcPtr = ((const uint32_t*) srcRow) + startX;
307 SkPMColor* dstPtr = (SkPMColor*) dstRow;
308 for (int i = 0; i < width; i++) {
309 uint32_t p = srcPtr[0];
310 uint8_t red = masks->getRed(p);
311 uint8_t green = masks->getGreen(p);
312 uint8_t blue = masks->getBlue(p);
313 uint8_t alpha = masks->getAlpha(p);
314 dstPtr[i] = SkPackARGB_as_RGBA(alpha, red, green, blue);
315 srcPtr += sampleX;
316 }
317}