From 19d37a310c056ff7316ef802195ea33563a6e035 Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Fri, 1 Sep 2023 11:41:43 -0400 Subject: [PATCH] Migrate Fuchsia VK calls of GrBackend* (flutter/engine#45380) Follow-up to https://github.com/flutter/engine/pull/45325 No functional change. --- .../shell/platform/fuchsia/flutter/vulkan_surface.cc | 5 +++-- .../platform/fuchsia/flutter/vulkan_surface_producer.cc | 6 ++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/vulkan_surface.cc b/engine/src/flutter/shell/platform/fuchsia/flutter/vulkan_surface.cc index 5304b43f61..dc640c84f1 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/vulkan_surface.cc +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/vulkan_surface.cc @@ -18,6 +18,7 @@ #include "third_party/skia/include/gpu/GrBackendSurface.h" #include "third_party/skia/include/gpu/GrDirectContext.h" #include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h" +#include "third_party/skia/include/gpu/ganesh/vk/GrVkBackendSurface.h" #include "vulkan/vulkan_core.h" #include "vulkan/vulkan_fuchsia.h" @@ -408,8 +409,8 @@ bool VulkanSurface::SetupSkiaSurface(sk_sp context, image_info.fSampleCount = 1; image_info.fLevelCount = image_create_info.mipLevels; - GrBackendRenderTarget sk_render_target(size.width(), size.height(), - image_info); + auto sk_render_target = + GrBackendRenderTargets::MakeVk(size.width(), size.height(), image_info); SkSurfaceProps sk_surface_props(0, kUnknown_SkPixelGeometry); diff --git a/engine/src/flutter/shell/platform/fuchsia/flutter/vulkan_surface_producer.cc b/engine/src/flutter/shell/platform/fuchsia/flutter/vulkan_surface_producer.cc index 824b4e1093..24394e4cfc 100644 --- a/engine/src/flutter/shell/platform/fuchsia/flutter/vulkan_surface_producer.cc +++ b/engine/src/flutter/shell/platform/fuchsia/flutter/vulkan_surface_producer.cc @@ -19,6 +19,7 @@ #include "third_party/skia/include/gpu/GrBackendSemaphore.h" #include "third_party/skia/include/gpu/GrBackendSurface.h" #include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h" +#include "third_party/skia/include/gpu/ganesh/vk/GrVkBackendSurface.h" #include "third_party/skia/include/gpu/vk/GrVkBackendContext.h" #include "third_party/skia/include/gpu/vk/GrVkExtensions.h" #include "third_party/skia/include/gpu/vk/GrVkTypes.h" @@ -228,7 +229,7 @@ bool VulkanSurfaceProducer::TransitionSurfacesToExternal( return false; } GrVkImageInfo imageInfo; - if (!backendRT.getVkImageInfo(&imageInfo)) { + if (!GrBackendRenderTargets::GetVkImageInfo(backendRT, &imageInfo)) { return false; } @@ -259,7 +260,8 @@ bool VulkanSurfaceProducer::TransitionSurfacesToExternal( 1, &image_barrier)) return false; - backendRT.setVkImageLayout(image_barrier.newLayout); + GrBackendRenderTargets::SetVkImageLayout(&backendRT, + image_barrier.newLayout); if (!command_buffer->End()) return false;