| 1 | // Copyright 2013 The Flutter Authors. All rights reserved. |
|---|---|
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "flutter/vulkan/vulkan_skia_proc_table.h" |
| 6 | |
| 7 | namespace vulkan { |
| 8 | |
| 9 | GrVkGetProc CreateSkiaGetProc(const fml::RefPtr<vulkan::VulkanProcTable>& vk) { |
| 10 | if (!vk || !vk->IsValid()) { |
| 11 | return nullptr; |
| 12 | } |
| 13 | |
| 14 | return [vk](const char* proc_name, VkInstance instance, VkDevice device) { |
| 15 | if (device != VK_NULL_HANDLE) { |
| 16 | auto result = |
| 17 | vk->AcquireProc(proc_name, device: VulkanHandle<VkDevice>{device, nullptr}); |
| 18 | if (result != nullptr) { |
| 19 | return result; |
| 20 | } |
| 21 | } |
| 22 | |
| 23 | return vk->AcquireProc(proc_name, |
| 24 | instance: VulkanHandle<VkInstance>{instance, nullptr}); |
| 25 | }; |
| 26 | } |
| 27 | |
| 28 | } // namespace vulkan |
| 29 |
