Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 8540e00

Browse files
authored
Remove use of ctors on Skia Vulkan struct (#20630)
Skia is removing the ctors on these structs so removing them.
1 parent 8177937 commit 8540e00

File tree

2 files changed

+19
-16
lines changed

2 files changed

+19
-16
lines changed

shell/platform/fuchsia/flutter/vulkan_surface.cc

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -332,14 +332,19 @@ bool VulkanSurface::SetupSkiaSurface(sk_sp<GrDirectContext> context,
332332
return false;
333333
}
334334

335-
const GrVkImageInfo image_info = {
336-
vulkan_image_.vk_image, // image
337-
{vk_memory_, 0, memory_reqs.size, 0}, // alloc
338-
image_create_info.tiling, // tiling
339-
image_create_info.initialLayout, // layout
340-
image_create_info.format, // format
341-
image_create_info.mipLevels, // level count
342-
};
335+
GrVkAlloc alloc;
336+
alloc.fMemory = vk_memory_;
337+
alloc.fOffset = 0;
338+
alloc.fSize = memory_reqs.size;
339+
alloc.fFlags = 0;
340+
341+
GrVkImageInfo image_info;
342+
image_info.fImage = vulkan_image_.vk_image;
343+
image_info.fAlloc = alloc;
344+
image_info.fImageTiling = image_create_info.tiling;
345+
image_info.fImageLayout = image_create_info.initialLayout;
346+
image_info.fFormat = image_create_info.format;
347+
image_info.fLevelCount = image_create_info.mipLevels;
343348

344349
GrBackendRenderTarget sk_render_target(size.width(), size.height(), 0,
345350
image_info);

vulkan/vulkan_swapchain.cc

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -222,14 +222,12 @@ sk_sp<SkSurface> VulkanSwapchain::CreateSkiaSurface(
222222
return nullptr;
223223
}
224224

225-
const GrVkImageInfo image_info = {
226-
image, // image
227-
GrVkAlloc(), // alloc
228-
VK_IMAGE_TILING_OPTIMAL, // tiling
229-
VK_IMAGE_LAYOUT_UNDEFINED, // layout
230-
surface_format_.format, // format
231-
1, // level count
232-
};
225+
GrVkImageInfo image_info;
226+
image_info.fImage = image;
227+
image_info.fImageTiling = VK_IMAGE_TILING_OPTIMAL;
228+
image_info.fImageLayout = VK_IMAGE_LAYOUT_UNDEFINED;
229+
image_info.fFormat = surface_format_.format;
230+
image_info.fLevelCount = 1;
233231

234232
// TODO(chinmaygarde): Setup the stencil buffer and the sampleCnt.
235233
GrBackendRenderTarget backend_render_target(size.fWidth, size.fHeight, 0,

0 commit comments

Comments
 (0)