70 { kN32_SkColorType,
"0101111" },
91 for (
size_t i = 0; i < std::size(
gPairs); i++) {
108 for (
size_t j = 0; j < std::size(
gPairs); j++) {
128 if (
bitmap.extractSubset(&subset, r)) {
139 for (
int y = 0;
y < 4; ++
y) {
140 for (
int x = 0;
x < 4; ++
x) {
167 const size_t rowBytes =
W *
sizeof(
SkPMColor);
178 bool fExpectedSuccess;
185 {
true, { 0, 0 }, { 4, 4 }, { 0, 0 }, { 0, 0, 4, 4 } },
186 {
true, { 1, 1 }, { 2, 2 }, { 0, 0 }, { 1, 1, 3, 3 } },
187 {
true, { 2, 2 }, { 4, 4 }, { 0, 0 }, { 2, 2, 4, 4 } },
188 {
true, {-1,-1 }, { 2, 2 }, { 1, 1 }, { 0, 0, 1, 1 } },
189 {
false, {-1,-1 }, { 1, 1 }, { 0, 0 }, { 0, 0, 0, 0 } },
192 for (
size_t i = 0; i < std::size(
gRec); ++i) {
196 bool success = srcBM.
readPixels(dstInfo, dstPixels, rowBytes,
197 gRec[i].fRequestedSrcLoc.x(),
gRec[i].fRequestedSrcLoc.y());
202 const int dstX =
gRec[i].fExpectedDstLoc.
x();
203 const int dstY =
gRec[i].fExpectedDstLoc.y();
205 for (
int y = 0;
y <
H; ++
y) {
206 for (
int x = 0;
x <
W; ++
x) {
209 int sx =
x - dstX + srcR.
x();
210 int sy =
y - dstY + srcR.
y();
static bool check_4x4_pixel(SkPMColor color, unsigned x, unsigned y)
static void fill_4x4_pixels(SkPMColor colors[16])
static void setup_src_bitmaps(SkBitmap *srcOpaque, SkBitmap *srcPremul, SkColorType ct)
static void init_src(const SkBitmap &bitmap)
static void clear_4x4_pixels(SkPMColor colors[16])
static const Pair gPairs[]
static const struct @223 gRec[]
@ kOpaque_SkAlphaType
pixel is opaque
@ kPremul_SkAlphaType
pixel components are premultiplied by alpha
#define SkGetPackedB32(packed)
#define SkGetPackedR32(packed)
#define SkGetPackedA32(packed)
#define SkGetPackedG32(packed)
static SkPMColor SkPackARGB32(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
@ kARGB_4444_SkColorType
pixel with 4 bits for alpha, red, green, blue; in 16-bit word
@ kRGBA_F16_SkColorType
pixel with half floats for red, green, blue, alpha;
@ kAlpha_8_SkColorType
pixel with alpha in 8-bit byte
@ kRGB_565_SkColorType
pixel with 5 bits red, 6 bits green, 5 bits blue, in 16-bit word
@ kUnknown_SkColorType
uninitialized
constexpr SkColor SK_ColorWHITE
#define DEF_TEST(name, reporter)
#define REPORTER_ASSERT(r, cond,...)
void allocPixels(const SkImageInfo &info, size_t rowBytes)
bool installPixels(const SkImageInfo &info, void *pixels, size_t rowBytes, void(*releaseProc)(void *addr, void *context), void *context)
SkAlphaType alphaType() const
bool readPixels(const SkImageInfo &dstInfo, void *dstPixels, size_t dstRowBytes, int srcX, int srcY) const
uint32_t getGenerationID() const
static sk_sp< SkColorSpace > MakeSRGB()
void(* memset32)(uint32_t[], uint32_t, int)
SkIPoint * operator[](int i) const
constexpr int32_t x() const
constexpr int32_t y() const
void setLTRB(int32_t left, int32_t top, int32_t right, int32_t bottom)
bool contains(int32_t x, int32_t y) const
static SkImageInfo MakeN32Premul(int width, int height)
SkImageInfo makeDimensions(SkISize newSize) const
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)