20 void* dstRow,
const uint8_t* srcRow,
int width,
SkMasks* masks,
21 uint32_t startX, uint32_t sampleX) {
24 const uint16_t* srcPtr = ((
const uint16_t*) srcRow) + startX;
27 uint16_t
p = srcPtr[0];
37 void* dstRow,
const uint8_t* srcRow,
int width,
SkMasks* masks,
38 uint32_t startX, uint32_t sampleX) {
41 const uint16_t* srcPtr = ((
const uint16_t*) srcRow) + startX;
44 uint16_t
p = srcPtr[0];
54 void* dstRow,
const uint8_t* srcRow,
int width,
SkMasks* masks,
55 uint32_t startX, uint32_t sampleX) {
58 const uint16_t* srcPtr = ((
const uint16_t*) srcRow) + startX;
61 uint16_t
p = srcPtr[0];
72 void* dstRow,
const uint8_t* srcRow,
int width,
SkMasks* masks,
73 uint32_t startX, uint32_t sampleX) {
76 const uint16_t* srcPtr = ((
const uint16_t*) srcRow) + startX;
79 uint16_t
p = srcPtr[0];
90 void* dstRow,
const uint8_t* srcRow,
int width,
SkMasks* masks,
91 uint32_t startX, uint32_t sampleX) {
94 const uint16_t* srcPtr = ((
const uint16_t*) srcRow) + startX;
97 uint16_t
p = srcPtr[0];
108 void* dstRow,
const uint8_t* srcRow,
int width,
SkMasks* masks,
109 uint32_t startX, uint32_t sampleX) {
112 const uint16_t* srcPtr = ((
const uint16_t*) srcRow) + startX;
115 uint16_t
p = srcPtr[0];
116 uint8_t red = masks->
getRed(
p);
128 void* dstRow,
const uint8_t* srcRow,
int width,
SkMasks* masks,
129 uint32_t startX, uint32_t sampleX) {
132 const uint16_t* srcPtr = ((
const uint16_t*) srcRow) + startX;
133 uint16_t* dstPtr = (uint16_t*) dstRow;
135 uint16_t
p = srcPtr[0];
136 uint8_t red = masks->
getRed(
p);
145 void* dstRow,
const uint8_t* srcRow,
int width,
SkMasks* masks,
146 uint32_t startX, uint32_t sampleX) {
149 srcRow += 3 * startX;
152 uint32_t
p = srcRow[0] | (srcRow[1] << 8) | srcRow[2] << 16;
153 uint8_t red = masks->
getRed(
p);
157 srcRow += 3 * sampleX;
162 void* dstRow,
const uint8_t* srcRow,
int width,
SkMasks* masks,
163 uint32_t startX, uint32_t sampleX) {
166 srcRow += 3 * startX;
169 uint32_t
p = srcRow[0] | (srcRow[1] << 8) | srcRow[2] << 16;
170 uint8_t red = masks->
getRed(
p);
174 srcRow += 3 * sampleX;
179 void* dstRow,
const uint8_t* srcRow,
int width,
SkMasks* masks,
180 uint32_t startX, uint32_t sampleX) {
183 srcRow += 3 * startX;
186 uint32_t
p = srcRow[0] | (srcRow[1] << 8) | srcRow[2] << 16;
187 uint8_t red = masks->
getRed(
p);
192 srcRow += 3 * sampleX;
197 void* dstRow,
const uint8_t* srcRow,
int width,
SkMasks* masks,
198 uint32_t startX, uint32_t sampleX) {
201 srcRow += 3 * startX;
204 uint32_t
p = srcRow[0] | (srcRow[1] << 8) | srcRow[2] << 16;
205 uint8_t red = masks->
getRed(
p);
210 srcRow += 3 * sampleX;
215 void* dstRow,
const uint8_t* srcRow,
int width,
SkMasks* masks,
216 uint32_t startX, uint32_t sampleX) {
219 srcRow += 3 * startX;
222 uint32_t
p = srcRow[0] | (srcRow[1] << 8) | srcRow[2] << 16;
223 uint8_t red = masks->
getRed(
p);
228 srcRow += 3 * sampleX;
233 void* dstRow,
const uint8_t* srcRow,
int width,
SkMasks* masks,
234 uint32_t startX, uint32_t sampleX) {
237 srcRow += 3 * startX;
240 uint32_t
p = srcRow[0] | (srcRow[1] << 8) | srcRow[2] << 16;
241 uint8_t red = masks->
getRed(
p);
246 srcRow += 3 * sampleX;
251 void* dstRow,
const uint8_t* srcRow,
int width,
SkMasks* masks,
252 uint32_t startX, uint32_t sampleX) {
255 srcRow += 3 * startX;
256 uint16_t* dstPtr = (uint16_t*) dstRow;
258 uint32_t
p = srcRow[0] | (srcRow[1] << 8) | srcRow[2] << 16;
259 uint8_t red = masks->
getRed(
p);
263 srcRow += 3 * sampleX;
268 void* dstRow,
const uint8_t* srcRow,
int width,
SkMasks* masks,
269 uint32_t startX, uint32_t sampleX) {
272 const uint32_t* srcPtr = ((
const uint32_t*) srcRow) + startX;
275 uint32_t
p = srcPtr[0];
276 uint8_t red = masks->
getRed(
p);
285 void* dstRow,
const uint8_t* srcRow,
int width,
SkMasks* masks,
286 uint32_t startX, uint32_t sampleX) {
289 const uint32_t* srcPtr = ((
const uint32_t*) srcRow) + startX;
292 uint32_t
p = srcPtr[0];
293 uint8_t red = masks->
getRed(
p);
302 void* dstRow,
const uint8_t* srcRow,
int width,
SkMasks* masks,
303 uint32_t startX, uint32_t sampleX) {
306 const uint32_t* srcPtr = ((
const uint32_t*) srcRow) + startX;
309 uint32_t
p = srcPtr[0];
310 uint8_t red = masks->
getRed(
p);
320 void* dstRow,
const uint8_t* srcRow,
int width,
SkMasks* masks,
321 uint32_t startX, uint32_t sampleX) {
324 const uint32_t* srcPtr = ((
const uint32_t*) srcRow) + startX;
327 uint32_t
p = srcPtr[0];
328 uint8_t red = masks->
getRed(
p);
338 void* dstRow,
const uint8_t* srcRow,
int width,
SkMasks* masks,
339 uint32_t startX, uint32_t sampleX) {
342 const uint32_t* srcPtr = ((
const uint32_t*) srcRow) + startX;
345 uint32_t
p = srcPtr[0];
346 uint8_t red = masks->
getRed(
p);
356 void* dstRow,
const uint8_t* srcRow,
int width,
SkMasks* masks,
357 uint32_t startX, uint32_t sampleX) {
360 const uint32_t* srcPtr = ((
const uint32_t*) srcRow) + startX;
363 uint32_t
p = srcPtr[0];
364 uint8_t red = masks->
getRed(
p);
374 void* dstRow,
const uint8_t* srcRow,
int width,
SkMasks* masks,
375 uint32_t startX, uint32_t sampleX) {
377 const uint32_t* srcPtr = ((
const uint32_t*) srcRow) + startX;
378 uint16_t* dstPtr = (uint16_t*) dstRow;
380 uint32_t
p = srcPtr[0];
381 uint8_t red = masks->
getRed(
p);
395 bool srcIsOpaque,
SkMasks* masks, uint32_t bitsPerPixel,
399 RowProc proc =
nullptr;
400 switch (bitsPerPixel) {
530 int srcWidth = dstInfo.
width();
532 srcOffset =
options.fSubset->left();
533 srcWidth =
options.fSubset->width();
544SkMaskSwizzler::SkMaskSwizzler(
SkMasks* masks, RowProc proc,
int srcOffset,
int subsetWidth)
547 , fSubsetWidth(subsetWidth)
548 , fDstWidth(subsetWidth)
550 , fSrcOffset(srcOffset)
554int SkMaskSwizzler::onSetSampleX(
int sampleX) {
574 fRowProc(
dst,
src, fDstWidth, fMasks, fX0, fSampleX);
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
static int get_scaled_dimension(int srcDimension, int sampleSize)
static SkPMColor premultiply_argb_as_rgba(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
static SkPMColor premultiply_argb_as_bgra(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
static int get_start_coord(int sampleFactor)
static uint32_t SkPackARGB_as_RGBA(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
static U16CPU SkPack888ToRGB16(U8CPU r, U8CPU g, U8CPU b)
static uint32_t SkPackARGB_as_BGRA(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
@ kBGRA_8888_SkColorType
pixel with 8 bits for blue, green, red, alpha; in 32-bit word
@ kRGB_565_SkColorType
pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
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_mask16_to_rgba_opaque(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_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_rgba_unpremul(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_mask32_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_opaque(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_mask32_to_bgra_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_mask16_to_bgra_premul(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_mask16_to_bgra_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_mask16_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_mask16_to_bgra_unpremul(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_mask16_to_565(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)
void swizzle(void *dst, const uint8_t *SK_RESTRICT src)
static SkMaskSwizzler * CreateMaskSwizzler(const SkImageInfo &dstInfo, bool srcIsOpaque, SkMasks *masks, uint32_t bitsPerPixel, const SkCodec::Options &options)
uint8_t getAlpha(uint32_t pixel) const
uint8_t getBlue(uint32_t pixel) const
uint8_t getGreen(uint32_t pixel) const
uint8_t getRed(uint32_t pixel) const
SkAlphaType alphaType() const
SkColorType colorType() const