From 800005b4c980e5492e8cf798312e78f89129940e Mon Sep 17 00:00:00 2001 From: egdaniel Date: Mon, 4 Jun 2018 14:46:12 -0400 Subject: [PATCH] Update GrVkBackendContext to no longer own the VkInstance and VkDevice (flutter/engine#5457) This changes the ownership of the VkInstance and VkDevice back to the flutter's objects. I am trying to move skia into a world where GrVkBackendContext is purely a description of the vulkan context skia should use and is just passed in during GrContext creation. It shouldn't need to be ref counted or actually do work in destructor (those changes to come later). This is just a first step towards getting there. --- engine/src/flutter/vulkan/vulkan_window.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/engine/src/flutter/vulkan/vulkan_window.cc b/engine/src/flutter/vulkan/vulkan_window.cc index 907a15a097..4b9be79513 100644 --- a/engine/src/flutter/vulkan/vulkan_window.cc +++ b/engine/src/flutter/vulkan/vulkan_window.cc @@ -129,11 +129,6 @@ sk_sp VulkanWindow::CreateSkiaBackendContext() { return nullptr; } - // The Skia backend context takes ownership of the device and the instance. - // Make sure we release our ownership now. - logical_device_->ReleaseDeviceOwnership(); - application_->ReleaseInstanceOwnership(); - auto context = sk_make_sp(); context->fInstance = application_->GetInstance(); context->fPhysicalDevice = logical_device_->GetPhysicalDeviceHandle(); @@ -146,6 +141,7 @@ sk_sp VulkanWindow::CreateSkiaBackendContext() { surface_->GetNativeSurface().GetSkiaExtensionName(); context->fFeatures = skia_features; context->fInterface.reset(interface.release()); + context->fOwnsInstanceAndDevice = false; return context; }