Lines Matching refs:pixels

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