diff --git a/engine/src/flutter/vulkan/vulkan_swapchain.cc b/engine/src/flutter/vulkan/vulkan_swapchain.cc index 95b0cd4770..0c515d80ac 100644 --- a/engine/src/flutter/vulkan/vulkan_swapchain.cc +++ b/engine/src/flutter/vulkan/vulkan_swapchain.cc @@ -9,6 +9,7 @@ #include "flutter/vulkan/vulkan_image.h" #include "flutter/vulkan/vulkan_proc_table.h" #include "flutter/vulkan/vulkan_surface.h" +#include "third_party/skia/include/gpu/GrBackendSurface.h" #include "third_party/skia/include/gpu/vk/GrVkTypes.h" #include "third_party/skia/src/gpu/vk/GrVkUtil.h" @@ -205,26 +206,18 @@ sk_sp VulkanSwapchain::CreateSkiaSurface(GrContext* gr_context, .fLevelCount = 1, }; - GrBackendRenderTargetDesc desc; - desc.fWidth = size.fWidth; - desc.fHeight = size.fHeight; - desc.fConfig = pixel_config; - desc.fOrigin = kTopLeft_GrSurfaceOrigin; - // TODO(chinmaygarde): Setup the stencil buffer and the sampleCnt. - desc.fSampleCnt = 0; - desc.fStencilBits = 0; - - desc.fRenderTargetHandle = reinterpret_cast(&image_info); - + GrBackendRenderTarget backend_render_target(size.fWidth, size.fHeight, 0, 0, + image_info); SkSurfaceProps props(SkSurfaceProps::InitType::kLegacyFontHost_InitType); return SkSurface::MakeFromBackendRenderTarget( - gr_context, // context - desc, // backend render target description + gr_context, // context + backend_render_target, // backend render target + kTopLeft_GrSurfaceOrigin, SkColorSpaceFromVkFormat(surface_format_.format), // colorspace &props // surface properties - ); + ); } bool VulkanSwapchain::CreateSwapchainImages(GrContext* skia_context) {