Lines Matching refs:pixels
101 static void Release(const void* pixels, void* context) {
254 SkPMColor pixels[4];
255 memset(pixels, 0xFF, sizeof(pixels)); // init with values we don't expect
256 image->readPixels(dstInfo, pixels, dstRowBytes, 0, 0);
257 REPORTER_ASSERT(reporter, red == pixels[0]);
258 REPORTER_ASSERT(reporter, green == pixels[1]);
259 REPORTER_ASSERT(reporter, blue == pixels[2]);
260 REPORTER_ASSERT(reporter, 0 == pixels[3]);
273 SkPMColor pixels[4];
274 memset(pixels, 0xFF, sizeof(pixels)); // init with values we don't expect
279 REPORTER_ASSERT(reporter, image1->readPixels(dstInfo, pixels, dstRowBytes, 0, 0));
280 for (size_t i = 0; i < SK_ARRAY_COUNT(pixels); ++i) {
281 REPORTER_ASSERT(reporter, pixels[i] == green);
291 REPORTER_ASSERT(reporter, image2->readPixels(dstInfo, pixels, dstRowBytes, 0, 0));
292 REPORTER_ASSERT(reporter, pixels[0] == green);
293 REPORTER_ASSERT(reporter, pixels[1] == green);
294 REPORTER_ASSERT(reporter, pixels[2] == green);
295 REPORTER_ASSERT(reporter, pixels[3] == red);
486 static bool has_pixels(const SkPMColor pixels[], int count, SkPMColor expected) {
488 if (pixels[i] != expected) {
501 SkPMColor pixels[w*h];
506 REPORTER_ASSERT(reporter, !image->readPixels(info, pixels, rowBytes, 0, 0));
510 REPORTER_ASSERT(reporter, !image->readPixels(info, pixels, rowBytes, -w, 0));
511 REPORTER_ASSERT(reporter, !image->readPixels(info, pixels, rowBytes, 0, -h));
512 REPORTER_ASSERT(reporter, !image->readPixels(info, pixels, rowBytes, image->width(), 0));
513 REPORTER_ASSERT(reporter, !image->readPixels(info, pixels, rowBytes, 0, image->height()));
516 sk_memset32(pixels, notExpected, w*h);
517 REPORTER_ASSERT(reporter, image->readPixels(info, pixels, rowBytes, 0, 0));
518 REPORTER_ASSERT(reporter, has_pixels(pixels, w*h, expected));
521 sk_memset32(pixels, notExpected, w*h);
522 REPORTER_ASSERT(reporter, image->readPixels(info, pixels, rowBytes,
524 REPORTER_ASSERT(reporter, has_pixels(pixels, w*h, expected));
527 sk_memset32(pixels, notExpected, w*h);
528 REPORTER_ASSERT(reporter, image->readPixels(info, pixels, rowBytes, -1, -1));
529 REPORTER_ASSERT(reporter, pixels[3] == expected);
530 REPORTER_ASSERT(reporter, has_pixels(pixels, w*h - 1, notExpected));
533 sk_memset32(pixels, notExpected, w*h);
534 REPORTER_ASSERT(reporter, image->readPixels(info, pixels, rowBytes,
536 REPORTER_ASSERT(reporter, pixels[0] == expected);
537 REPORTER_ASSERT(reporter, has_pixels(&pixels[1], w*h - 1, notExpected));
730 // write pixels call violated the contract with refImg and refImg is now undefined.