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.
This commit is contained in:
egdaniel
2018-06-04 14:46:12 -04:00
committed by Brian Osman
parent 05f8cdb39b
commit 800005b4c9

View File

@@ -129,11 +129,6 @@ sk_sp<GrVkBackendContext> 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<GrVkBackendContext>();
context->fInstance = application_->GetInstance();
context->fPhysicalDevice = logical_device_->GetPhysicalDeviceHandle();
@@ -146,6 +141,7 @@ sk_sp<GrVkBackendContext> VulkanWindow::CreateSkiaBackendContext() {
surface_->GetNativeSurface().GetSkiaExtensionName();
context->fFeatures = skia_features;
context->fInterface.reset(interface.release());
context->fOwnsInstanceAndDevice = false;
return context;
}