Skip to content

Commit

Permalink
Update GrVkBackendContext to no longer own the VkInstance and VkDevice (
Browse files Browse the repository at this point in the history
flutter#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.
  • Loading branch information
egdaniel authored and brianosman committed Jun 4, 2018
1 parent 975d4ea commit 8c84737
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions vulkan/vulkan_window.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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;
}

Expand Down

0 comments on commit 8c84737

Please sign in to comment.