Home | History | Annotate | Download | only in tests

Lines Matching refs:SkImage

27 static void assert_equal(skiatest::Reporter* reporter, SkImage* a, const SkIRect* subsetA,
28 SkImage* b) {
64 static SkImage* create_image() {
82 static SkImage* create_data_image() {
85 return SkImage::NewRasterData(info, data, info.minRowBytes());
88 static SkImage* create_picture_image() {
93 return SkImage::NewFromPicture(picture, SkISize::Make(10, 10), nullptr, nullptr);
107 static SkImage* create_rasterproc_image(RasterDataHolder* dataHolder) {
112 return SkImage::NewFromRaster(info, data->data(), info.minRowBytes(),
115 static SkImage* create_codec_image() {
122 return SkImage::NewFromEncoded(src);
125 static SkImage* create_gpu_image(GrContext* context) {
134 static void test_encode(skiatest::Reporter* reporter, SkImage* image) {
140 SkAutoTUnref<SkImage> decoded(SkImage::NewFromEncoded(origEncoded));
146 decoded.reset(SkImage::NewFromEncoded(origEncoded, &ir));
152 SkAutoTUnref<SkImage> image(create_image());
158 SkAutoTUnref<SkImage> image(create_gpu_image(context));
192 // Test that SkImage encoding observes custom pixel serializers.
195 SkAutoTUnref<SkImage> image(create_image());
209 SkAutoTUnref<SkImage> image(surface->newImageSnapshot());
248 SkAutoTUnref<SkImage> image(SkImage::NewRasterCopy(srcInfo, indices, srcRowBytes, ctable));
278 SkAutoTUnref<SkImage> image1(surface->newImageSnapshot());
290 SkAutoTUnref<SkImage> image2(surface->newImageSnapshot());
324 SkAutoTUnref<SkImage> image(SkImage::NewFromBitmap(bm));
353 SkAutoTUnref<SkImage> image(create_gpu_image(context));
392 std::function<SkImage*()> imageFactories[] = {
403 SkImage* otherContextImage = create_gpu_image(otherContextInfo.fGrContext);
410 SkAutoTUnref<SkImage> image(factory());
417 SkAutoTUnref<SkImage> texImage(image->newTextureImage(context));
456 SkAutoTUnref<SkImage> img(SkImage::NewFromBitmap(bm));
467 REPORTER_ASSERT(reporter, nullptr == SkImage::NewRasterCopy(info, nullptr, 0));
468 REPORTER_ASSERT(reporter, nullptr == SkImage::NewRasterData(info, nullptr, 0));
469 REPORTER_ASSERT(reporter, nullptr == SkImage::NewFromRaster(info, nullptr, 0, nullptr, nullptr));
470 REPORTER_ASSERT(reporter, nullptr == SkImage::NewFromGenerator(new EmptyGenerator));
479 SkImage* image = SkImage::NewRasterData(info, data, rowBytes);
495 static void test_read_pixels(skiatest::Reporter* reporter, SkImage* image) {
540 SkAutoTUnref<SkImage> image(create_image());
557 SkAutoTUnref<SkImage> image(create_gpu_image(context));
562 static void check_legacy_bitmap(skiatest::Reporter* reporter, const SkImage* image,
563 const SkBitmap& bitmap, SkImage::LegacyBitmapMode mode) {
568 if (SkImage::kRO_LegacyBitmapMode == mode) {
581 static void test_legacy_bitmap(skiatest::Reporter* reporter, const SkImage* image, SkImage::LegacyBitmapMode mode) {
590 SkAutoTUnref<SkImage> subsetImage(SkImage::NewFromBitmap(tmp));
598 const SkImage::LegacyBitmapMode modes[] = {
599 SkImage::kRO_LegacyBitmapMode,
600 SkImage::kRW_LegacyBitmapMode,
603 SkAutoTUnref<SkImage> image(create_image());
621 const SkImage::LegacyBitmapMode modes[] = {
622 SkImage::kRO_LegacyBitmapMode,
623 SkImage::kRW_LegacyBitmapMode,
626 SkAutoTUnref<SkImage> image(create_gpu_image(context));
632 static void test_peek(skiatest::Reporter* reporter, SkImage* image, bool expectPeekSuccess) {
649 SkAutoTUnref<SkImage> image(create_image());
666 SkAutoTUnref<SkImage> image(create_gpu_image(context));
679 static void check_image_color(skiatest::Reporter* reporter, SkImage* image, SkPMColor expected) {
713 SkAutoTUnref<SkImage> refImg(
714 SkImage::NewFromTexture(context, backendDesc, kPremul_SkAlphaType,
716 SkAutoTUnref<SkImage> cpyImg(SkImage::NewFromTextureCopy(context, backendDesc,