Go to the source code of this file.
|
static void | Clamp_S32_opaque_D32_nofilter_DX_shaderproc (const void *sIn, int x, int y, SkPMColor *dst, int count) |
|
static void | S32_alpha_D32_nofilter_DX (const SkBitmapProcState &s, const uint32_t *xy, int count, SkPMColor *colors) |
|
static void | S32_alpha_D32_nofilter_DXDY (const SkBitmapProcState &s, const uint32_t *xy, int count, SkPMColor *colors) |
|
static bool | matrix_only_scale_translate (const SkMatrix &m) |
|
static bool | just_trans_general (const SkMatrix &matrix) |
|
static bool | just_trans_integral (const SkMatrix &m) |
|
static bool | valid_for_filtering (unsigned dimension) |
|
static void | Clamp_S32_D32_nofilter_trans_shaderproc (const void *sIn, int x, int y, SkPMColor *colors, int count) |
|
static int | sk_int_mod (int x, int n) |
|
static int | sk_int_mirror (int x, int n) |
|
static void | Repeat_S32_D32_nofilter_trans_shaderproc (const void *sIn, int x, int y, SkPMColor *colors, int count) |
|
static void | filter_32_alpha (unsigned t, SkPMColor color0, SkPMColor color1, SkPMColor *dstColor, unsigned alphaScale) |
|
static void | S32_D32_constX_shaderproc (const void *sIn, int x, int y, SkPMColor *colors, int count) |
|
static void | DoNothing_shaderproc (const void *, int x, int y, SkPMColor *colors, int count) |
|
◆ Clamp_S32_D32_nofilter_trans_shaderproc()
static void Clamp_S32_D32_nofilter_trans_shaderproc |
( |
const void * |
sIn, |
|
|
int |
x, |
|
|
int |
y, |
|
|
SkPMColor * |
colors, |
|
|
int |
count |
|
) |
| |
|
static |
Definition at line 302 of file SkBitmapProcState.cpp.
305 {
310
311 const int maxX =
s.fPixmap.width() - 1;
312 const int maxY =
s.fPixmap.height() - 1;
313 int ix =
s.fFilterOneX +
x;
314 int iy =
SkTPin(
s.fFilterOneY +
y, 0, maxY);
315 const SkPMColor* row =
s.fPixmap.addr32(0, iy);
316
317
318 if (ix < 0) {
323 return;
324 }
327 ix = 0;
328 }
329
330 if (ix <= maxX) {
335 return;
336 }
338 }
340
342}
static constexpr const T & SkTPin(const T &x, const T &lo, const T &hi)
static float min(float r, float g, float b)
void(* memset32)(uint32_t[], uint32_t, int)
PODArray< SkColor > colors
◆ Clamp_S32_opaque_D32_nofilter_DX_shaderproc()
static void Clamp_S32_opaque_D32_nofilter_DX_shaderproc |
( |
const void * |
sIn, |
|
|
int |
x, |
|
|
int |
y, |
|
|
SkPMColor * |
dst, |
|
|
int |
count |
|
) |
| |
|
static |
Definition at line 33 of file SkBitmapProcState.cpp.
34 {
36 SkASSERT(
s.fInvMatrix.isScaleTranslate());
38
39 const unsigned maxX =
s.fPixmap.width() - 1;
41 int dstY;
42 {
44 const unsigned maxY =
s.fPixmap.height() - 1;
45 dstY = SkTPin<int>(mapper.intY(), 0, maxY);
46 fx = mapper.fractionalIntX();
47 }
48
51
52
53
56 {
57 int count4 =
count >> 2;
58 for (
int i = 0;
i < count4; ++
i) {
68 }
69 for (
int i = (count4 << 2);
i <
count; ++
i) {
74 }
75 } else {
79 }
80 }
81}
SkFixed3232 SkFractionalInt
#define SkFractionalIntToInt(x)
skia_private::AutoTArray< sk_sp< SkImageFilter > > filters TypedMatrix matrix TypedMatrix matrix SkScalar dx
◆ DoNothing_shaderproc()
static void DoNothing_shaderproc |
( |
const void * |
, |
|
|
int |
x, |
|
|
int |
y, |
|
|
SkPMColor * |
colors, |
|
|
int |
count |
|
) |
| |
|
static |
◆ filter_32_alpha()
Definition at line 392 of file SkBitmapProcState.cpp.
396 {
399
400 const uint32_t mask = 0xFF00FF;
401
402 int scale = 256 - 16*t;
403 uint32_t lo = (color0 & mask) *
scale;
404 uint32_t hi = ((color0 >> 8) & mask) *
scale;
405
407 lo += (color1 & mask) *
scale;
408 hi += ((color1 >> 8) & mask) *
scale;
409
410
411 lo = ((lo >> 8) & mask) * alphaScale;
412 hi = ((hi >> 8) & mask) * alphaScale;
413
414 *dstColor = ((lo >> 8) & mask) | (hi & ~mask);
415}
◆ just_trans_general()
static bool just_trans_general |
( |
const SkMatrix & |
matrix | ) |
|
|
static |
For the purposes of drawing bitmaps, if a matrix is "almost" translate go ahead and treat it as if it were, so that subsequent code can go fast.
Definition at line 162 of file SkBitmapProcState.cpp.
162 {
164
166
169}
static bool matrix_only_scale_translate(const SkMatrix &m)
static bool SkScalarNearlyZero(SkScalar x, SkScalar tolerance=SK_ScalarNearlyZero)
static constexpr int kMScaleX
horizontal scale factor
static constexpr int kMScaleY
vertical scale factor
unsigned useCenter Optional< SkMatrix > matrix
◆ just_trans_integral()
static bool just_trans_integral |
( |
const SkMatrix & |
m | ) |
|
|
static |
Determine if the matrix can be treated as integral-only-translate, for the purpose of filtering.
Definition at line 175 of file SkBitmapProcState.cpp.
175 {
177
181}
static bool SkScalarNearlyEqual(SkScalar x, SkScalar y, SkScalar tolerance=SK_ScalarNearlyZero)
#define SkScalarRoundToScalar(x)
@ kTranslate_Mask
translation SkMatrix
◆ matrix_only_scale_translate()
static bool matrix_only_scale_translate |
( |
const SkMatrix & |
m | ) |
|
|
static |
◆ Repeat_S32_D32_nofilter_trans_shaderproc()
static void Repeat_S32_D32_nofilter_trans_shaderproc |
( |
const void * |
sIn, |
|
|
int |
x, |
|
|
int |
y, |
|
|
SkPMColor * |
colors, |
|
|
int |
count |
|
) |
| |
|
static |
Definition at line 364 of file SkBitmapProcState.cpp.
367 {
372
373 const int stopX =
s.fPixmap.width();
374 const int stopY =
s.fPixmap.height();
375 int ix =
s.fFilterOneX +
x;
377 const SkPMColor* row =
s.fPixmap.addr32(0, iy);
378
380 for (;;) {
385 return;
386 }
388 ix = 0;
389 }
390}
static int sk_int_mod(int x, int n)
◆ S32_alpha_D32_nofilter_DX()
Definition at line 83 of file SkBitmapProcState.cpp.
84 {
86 SkASSERT(
s.fInvMatrix.isScaleTranslate());
88 SkASSERT(4 ==
s.fPixmap.info().bytesPerPixel());
90
91
94
95 auto row = (
const SkPMColor*)( (
const char*)
s.fPixmap.addr() +
y *
s.fPixmap.rowBytes() );
96
97 if (1 ==
s.fPixmap.width()) {
99 return;
100 }
101
102
104 uint32_t x01 = *xy++,
105 x23 = *xy++;
106
111
116
118 }
119
120
121 auto x = (
const uint16_t*)xy;
122 while (
count --> 0) {
124 }
125}
#define UNPACK_PRIMARY_SHORT(packed)
#define UNPACK_SECONDARY_SHORT(packed)
static SK_ALWAYS_INLINE uint32_t SkAlphaMulQ(uint32_t c, unsigned scale)
◆ S32_alpha_D32_nofilter_DXDY()
Definition at line 127 of file SkBitmapProcState.cpp.
128 {
131 SkASSERT(4 ==
s.fPixmap.info().bytesPerPixel());
133
134 auto src = (
const char*)
s.fPixmap.addr();
135 size_t rb =
s.fPixmap.rowBytes();
136
137 while (
count --> 0) {
138 uint32_t XY = *xy++,
144 }
145}
◆ S32_D32_constX_shaderproc()
static void S32_D32_constX_shaderproc |
( |
const void * |
sIn, |
|
|
int |
x, |
|
|
int |
y, |
|
|
SkPMColor * |
colors, |
|
|
int |
count |
|
) |
| |
|
static |
Definition at line 417 of file SkBitmapProcState.cpp.
420 {
422 SkASSERT(
s.fInvMatrix.isScaleTranslate());
425
426 int iY0;
429
432 uint32_t xy[2];
433
434 mproc(
s, xy, 1,
x,
y);
435
436 iY0 = xy[0] >> 18;
437 iY1 = xy[0] & 0x3FFF;
438 iSubY = (xy[0] >> 14) & 0xF;
439 } else {
440 int yTemp;
441
442 if (
s.fInvMatrix.isTranslate()) {
443 yTemp =
s.fFilterOneY +
y;
444 } else{
446
447
448
449
450
453 } else {
454 yTemp = mapper.intY();
455 }
456 }
457
458 const int stopY =
s.fPixmap.height();
459 switch (
s.fTileModeY) {
461 iY0 =
SkTPin(yTemp, 0, stopY-1);
462 break;
465 break;
467 default:
469 break;
470 }
471
472#ifdef SK_DEBUG
473 {
475 int iY2;
476
477 if (!
s.fInvMatrix.isTranslate() &&
480 } else {
481 iY2 = mapper.intY();
482 }
483
484 switch (
s.fTileModeY) {
486 iY2 =
SkTPin(iY2, 0, stopY-1);
487 break;
490 break;
492 default:
494 break;
495 }
496
498 }
499#endif
500 }
501
502 const SkPMColor* row0 =
s.fPixmap.addr32(0, iY0);
504
506 const SkPMColor* row1 =
s.fPixmap.addr32(0, iY1);
508 } else {
509 if (
s.fAlphaScale < 256) {
511 } else {
513 }
514 }
515
517}
static void filter_32_alpha(unsigned t, SkPMColor color0, SkPMColor color1, SkPMColor *dstColor, unsigned alphaScale)
static int sk_int_mirror(int x, int n)
#define SK_INIT_TO_AVOID_WARNING
void(* MatrixProc)(const SkBitmapProcState &, uint32_t bitmapXY[], int count, int x, int y)
◆ sk_int_mirror()
◆ sk_int_mod()
Definition at line 344 of file SkBitmapProcState.cpp.
344 {
346 if ((
unsigned)
x >= (
unsigned)n) {
349 } else {
351 }
352 }
354}
◆ valid_for_filtering()
static bool valid_for_filtering |
( |
unsigned |
dimension | ) |
|
|
static |