164 {
167 const size_t rowBytes =
W *
sizeof(
SkPMColor);
173
176
177 const struct {
178 bool fExpectedSuccess;
181
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 } },
190 };
191
194
196 bool success = srcBM.
readPixels(dstInfo, dstPixels, rowBytes,
197 gRec[
i].fRequestedSrcLoc.x(),
gRec[
i].fRequestedSrcLoc.y());
198
200 if (success) {
202 const int dstX =
gRec[
i].fExpectedDstLoc.x();
203 const int dstY =
gRec[
i].fExpectedDstLoc.y();
204
205 for (
int y = 0;
y <
H; ++
y) {
206 for (
int x = 0;
x <
W; ++
x) {
208
209 int sx =
x - dstX + srcR.
x();
210 int sy =
y - dstY + srcR.
y();
213 } else {
215 }
216 }
217 }
218 }
219 }
220}
static bool check_4x4_pixel(SkPMColor color, unsigned x, unsigned y)
static void fill_4x4_pixels(SkPMColor colors[16])
static void clear_4x4_pixels(SkPMColor colors[16])
static const struct @223 gRec[]
bool installPixels(const SkImageInfo &info, void *pixels, size_t rowBytes, void(*releaseProc)(void *addr, void *context), void *context)
bool readPixels(const SkImageInfo &dstInfo, void *dstPixels, size_t dstRowBytes, int srcX, int srcY) const
constexpr int32_t x() const
constexpr int32_t y() const
bool contains(int32_t x, int32_t y) const
static SkImageInfo MakeN32Premul(int width, int height)
SkImageInfo makeDimensions(SkISize newSize) const