Commit 92006067 authored by Greg Daniel's avatar Greg Daniel Committed by Commit Bot

Use GrContext vulkan factory that doesn't take an sk_sp for GrVkBackendContext.

Skia is removing the ref counted-ness of GrVkBackendContext so this is a first
step towards that.

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel
Change-Id: Ie917d271b30433283a789de60b4eaa71489235f1
Reviewed-on: https://chromium-review.googlesource.com/1102493Reviewed-by: default avatarChris Blume <cblume@chromium.org>
Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Commit-Queue: Greg Daniel <egdaniel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569359}
parent bfa83bbb
......@@ -53,27 +53,26 @@ bool VulkanInProcessContextProvider::Initialize() {
const uint32_t extension_flags =
kEXT_debug_report_GrVkExtensionFlag | kKHR_surface_GrVkExtensionFlag |
kKHR_swapchain_GrVkExtensionFlag | kKHR_xcb_surface_GrVkExtensionFlag;
GrVkBackendContext* backend_context = new GrVkBackendContext();
backend_context->fInstance = device_queue_->GetVulkanInstance();
backend_context->fPhysicalDevice = device_queue_->GetVulkanPhysicalDevice();
backend_context->fDevice = device_queue_->GetVulkanDevice();
backend_context->fQueue = device_queue_->GetVulkanQueue();
backend_context->fGraphicsQueueIndex = device_queue_->GetVulkanQueueIndex();
backend_context->fMinAPIVersion = VK_MAKE_VERSION(1, 0, 8);
backend_context->fExtensions = extension_flags;
backend_context->fFeatures = feature_flags;
GrVkBackendContext backend_context;
backend_context.fInstance = device_queue_->GetVulkanInstance();
backend_context.fPhysicalDevice = device_queue_->GetVulkanPhysicalDevice();
backend_context.fDevice = device_queue_->GetVulkanDevice();
backend_context.fQueue = device_queue_->GetVulkanQueue();
backend_context.fGraphicsQueueIndex = device_queue_->GetVulkanQueueIndex();
backend_context.fMinAPIVersion = VK_MAKE_VERSION(1, 0, 8);
backend_context.fExtensions = extension_flags;
backend_context.fFeatures = feature_flags;
gpu::VulkanFunctionPointers* vulkan_function_pointers =
gpu::GetVulkanFunctionPointers();
auto interface = sk_make_sp<GrVkInterface>(
make_unified_getter(vulkan_function_pointers->vkGetInstanceProcAddr,
vulkan_function_pointers->vkGetDeviceProcAddr),
backend_context->fInstance, backend_context->fDevice,
backend_context->fExtensions);
backend_context->fInterface.reset(interface.release());
backend_context->fOwnsInstanceAndDevice = false;
backend_context_.reset(backend_context);
gr_context_ = GrContext::MakeVulkan(backend_context_);
backend_context.fInstance, backend_context.fDevice,
backend_context.fExtensions);
backend_context.fInterface.reset(interface.release());
backend_context.fOwnsInstanceAndDevice = false;
gr_context_ = GrContext::MakeVulkan(backend_context);
return true;
}
......@@ -84,7 +83,6 @@ void VulkanInProcessContextProvider::Destroy() {
if (device_queue_) {
device_queue_->Destroy();
device_queue_.reset();
backend_context_.reset();
}
}
......
......@@ -45,7 +45,6 @@ class VIZ_COMMON_EXPORT VulkanInProcessContextProvider
sk_sp<GrContext> gr_context_;
gpu::VulkanImplementation* vulkan_implementation_;
std::unique_ptr<gpu::VulkanDeviceQueue> device_queue_;
sk_sp<GrVkBackendContext> backend_context_;
#endif
DISALLOW_COPY_AND_ASSIGN(VulkanInProcessContextProvider);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment