78 case 2: ((uint16_t*)
dst)[1] =
SkToU16((fx +
dx) >> 16); [[fallthrough]];
79 case 1: ((uint16_t*)
dst)[0] =
SkToU16((fx + 0) >> 16);
84template <
unsigned (*tilex)(SkFixed,
int),
unsigned (*tiley)(SkFixed,
int),
bool tryDecal>
86 uint32_t xy[],
int count,
int x,
int y) {
87 SkASSERT(
s.fInvMatrix.isScaleTranslate());
93 *xy++ = tiley(mapper.
fixedY(),
s.fPixmap.height() - 1);
97 const unsigned maxX =
s.fPixmap.width() - 1;
100 memset(xy, 0,
count *
sizeof(uint16_t));
123 auto xx = (uint16_t*)xy;
124 while (
count --> 0) {
130template <
unsigned (*tilex)(SkFixed,
int),
unsigned (*tiley)(SkFixed,
int)>
132 uint32_t xy[],
int count,
int x,
int y) {
133 SkASSERT(!
s.fInvMatrix.hasPerspective());
139 dx =
s.fInvSxFractionalInt,
140 dy =
s.fInvKyFractionalInt;
141 int maxX =
s.fPixmap.width () - 1,
142 maxY =
s.fPixmap.height() - 1;
144 while (
count --> 0) {
157 return (fx >> 12) & 0xf;
181template <
unsigned (*tile)(SkFixed,
int),
unsigned (*extract_low_bits)(SkFixed,
int)>
184 uint32_t packed = tile(
f,
max);
185 packed = (packed << 4) | extract_low_bits(
f,
max);
186 packed = (packed << 14) | tile((
f + one),
max);
190template <
unsigned (*tilex)(SkFixed,
int),
unsigned (*tiley)(SkFixed,
int),
unsigned (*extract_low_bits)(SkFixed,
int),
bool tryDecal>
192 uint32_t xy[],
int count,
int x,
int y) {
193 SkASSERT(
s.fInvMatrix.isScaleTranslate());
195 const unsigned maxX =
s.fPixmap.width() - 1;
200 const unsigned maxY =
s.fPixmap.height() - 1;
202 *xy++ = pack<tiley, extract_low_bits>(mapper.
fixedY(), maxY,
s.fFilterOneY);
212 while (
count --> 0) {
214 SkASSERT((fixedFx >> (16 + 14)) == 0);
215 *xy++ = (fixedFx >> 12 << 14) | ((fixedFx >> 16) + 1);
221 while (
count --> 0) {
227template <
unsigned (*tilex)(SkFixed,
int),
unsigned (*tiley)(SkFixed,
int),
unsigned (*extract_low_bits)(SkFixed,
int)>
229 uint32_t xy[],
int count,
int x,
int y) {
230 SkASSERT(!
s.fInvMatrix.hasPerspective());
235 oneY =
s.fFilterOneY;
239 dx =
s.fInvSxFractionalInt,
240 dy =
s.fInvKyFractionalInt;
241 unsigned maxX =
s.fPixmap.width () - 1,
242 maxY =
s.fPixmap.height() - 1;
243 while (
count --> 0) {
276 nofilter_scale <clamp, clamp, true>, filter_scale <clamp, clamp, extract_low_bits_clamp_clamp, true>,
277 nofilter_affine<clamp, clamp>, filter_affine<clamp, clamp, extract_low_bits_clamp_clamp>,
280 nofilter_scale <repeat, repeat, false>, filter_scale <repeat, repeat, extract_low_bits_general, false>,
281 nofilter_affine<repeat, repeat>, filter_affine<repeat, repeat, extract_low_bits_general>
284 nofilter_scale <mirror, mirror, false>, filter_scale <mirror, mirror, extract_low_bits_general, false>,
285 nofilter_affine<mirror, mirror>, filter_affine<mirror, mirror, extract_low_bits_general>,
293 if (
x < 0) {
x = 0; }
294 if (
x >= n) {
x = n - 1; }
307 if ((
unsigned)
x >= (
unsigned)n) {
330 while (
count --> 0) {
336 while (
count --> 0) {
342template< U16CPU (tiley)(
int x,
int n) >
344 uint32_t xy[],
int count,
int x,
int y) {
348 *xy++ = tiley(mapper.
intY(),
s.fPixmap.height());
349 int xpos = mapper.
intX();
351 const int width =
s.fPixmap.width();
354 memset(xy, 0,
count *
sizeof(uint16_t));
358 uint16_t* xptr =
reinterpret_cast<uint16_t*
>(xy);
367 memset(xptr, 0, n *
sizeof(uint16_t));
394template< U16CPU (tiley)(
int x,
int n) >
396 uint32_t xy[],
int count,
int x,
int y) {
400 *xy++ = tiley(mapper.
intY(),
s.fPixmap.height());
401 int xpos = mapper.
intX();
403 const int width =
s.fPixmap.width();
406 memset(xy, 0,
count *
sizeof(uint16_t));
410 uint16_t* xptr =
reinterpret_cast<uint16_t*
>(xy);
431template< U16CPU (tiley)(
int x,
int n) >
433 uint32_t xy[],
int count,
int x,
int y) {
437 *xy++ = tiley(mapper.
intY(),
s.fPixmap.height());
438 int xpos = mapper.
intX();
440 const int width =
s.fPixmap.width();
443 memset(xy, 0,
count *
sizeof(uint16_t));
447 uint16_t* xptr =
reinterpret_cast<uint16_t*
>(xy);
502 if (translate_only_matrix && !
fBilerp) {
504 default:
SkASSERT(
false); [[fallthrough]];
540 return ::pack<clamp, extract_low_bits_clamp_clamp>(
f,
max,
SK_Fixed1);
#define SK_NO_SANITIZE(A)
#define pack_two_shorts(pri, sec)
SkFixed3232 SkFractionalInt
#define SkFractionalIntToFixed(x)
#define SkFractionalIntToInt(x)
static void mirrorx_nofilter_trans(const SkBitmapProcState &s, uint32_t xy[], int count, int x, int y)
static unsigned extract_low_bits_clamp_clamp(SkFixed fx, int)
static void fill_backwards(uint16_t xptr[], int pos, int count)
static void fill_sequential(uint16_t xptr[], int pos, int count)
static U16CPU int_mirror(int x, int n)
static bool can_truncate_to_fixed_for_decal(SkFixed fx, SkFixed dx, int count, unsigned max)
static void filter_scale(const SkBitmapProcState &s, uint32_t xy[], int count, int x, int y)
static unsigned SK_USHIFT16(unsigned x)
static void nofilter_affine(const SkBitmapProcState &s, uint32_t xy[], int count, int x, int y)
static unsigned extract_low_bits_general(SkFixed fx, int max)
static void repeatx_nofilter_trans(const SkBitmapProcState &s, uint32_t xy[], int count, int x, int y)
static U16CPU int_repeat(int x, int n)
static void clampx_nofilter_trans(const SkBitmapProcState &s, uint32_t xy[], int count, int x, int y)
static const SkBitmapProcState::MatrixProc MirrorX_MirrorY_Procs[]
static unsigned mirror(SkFixed fx, int max)
static const SkBitmapProcState::MatrixProc RepeatX_RepeatY_Procs[]
static void decal_nofilter_scale(uint32_t dst[], SkFixed fx, SkFixed dx, int count)
static void nofilter_scale(const SkBitmapProcState &s, uint32_t xy[], int count, int x, int y)
static unsigned repeat(SkFixed fx, int max)
static U16CPU int_clamp(int x, int n)
static int sk_int_mod(int x, int n)
static unsigned clamp(SkFixed fx, int max)
static const SkBitmapProcState::MatrixProc ClampX_ClampY_Procs[]
static uint32_t pack(SkFixed f, unsigned max, SkFixed one)
static void filter_affine(const SkBitmapProcState &s, uint32_t xy[], int count, int x, int y)
#define SkFixedFloorToInt(x)
static constexpr int32_t SkLeftShift(int32_t value, int32_t shift)
static int64_t sk_64_mul(int64_t a, int64_t b)
static constexpr const T & SkTPin(const T &x, const T &lo, const T &hi)
constexpr uint16_t SkToU16(S x)
SkFractionalInt fractionalIntY() const
SkFractionalInt fractionalIntX() const
bool isScaleTranslate() const
bool hasPerspective() const
static float max(float r, float g, float b)
void(* memset16)(uint16_t[], uint16_t, int)
skia_private::AutoTArray< sk_sp< SkImageFilter > > filters TypedMatrix matrix TypedMatrix matrix SkScalar dx
uint32_t pack_repeat(SkFixed f, unsigned max, size_t width)
uint32_t pack_mirror(SkFixed f, unsigned max, size_t width)
uint32_t pack_clamp(SkFixed f, unsigned max)
void(* MatrixProc)(const SkBitmapProcState &, uint32_t bitmapXY[], int count, int x, int y)