27 {
28 auto image_result = context.CreateImage(surface_size);
29
30 if (!image_result.has_value()) {
32 return nullptr;
33 }
34
36 .
fImage = image_result.value().GetImage(),
44 .fSampleCount = 1,
45 .fLevelCount = 1,
46 };
48 surface_size.
width(), surface_size.
height(), image_info);
49
51
52 auto result = std::unique_ptr<TestVulkanSurface>(
53 new TestVulkanSurface(std::move(image_result.value())));
55 context.GetGrDirectContext().get(),
56 backend_texture,
58 1,
61 &surface_properties,
62 nullptr,
63 nullptr
64 );
65
68 << "Could not wrap VkImage as an SkSurface Vulkan render texture.";
69 return nullptr;
70 }
71
73}
@ kTopLeft_GrSurfaceOrigin
@ kRGBA_8888_SkColorType
pixel with 8 bits for red, green, blue, alpha; in 32-bit word
@ kUnknown_SkPixelGeometry
static sk_sp< SkColorSpace > MakeSRGB()
#define FML_LOG(severity)
SK_API GrBackendTexture MakeVk(int width, int height, const GrVkImageInfo &, std::string_view label={})
SK_API sk_sp< SkSurface > WrapBackendTexture(GrRecordingContext *context, const GrBackendTexture &backendTexture, GrSurfaceOrigin origin, int sampleCnt, SkColorType colorType, sk_sp< SkColorSpace > colorSpace, const SkSurfaceProps *surfaceProps, TextureReleaseProc textureReleaseProc=nullptr, ReleaseContext releaseContext=nullptr)
constexpr int32_t width() const
constexpr int32_t height() const
@ VK_IMAGE_LAYOUT_UNDEFINED
@ VK_IMAGE_TILING_OPTIMAL
@ VK_IMAGE_USAGE_TRANSFER_DST_BIT
@ VK_IMAGE_USAGE_SAMPLED_BIT
@ VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
@ VK_IMAGE_USAGE_TRANSFER_SRC_BIT
@ VK_FORMAT_R8G8B8A8_UNORM