#include "ui/ozone/platform/headless/vulkan_implementation_headless.h"
#include <optional>
#include "base/base_paths.h"
#include "base/files/file_path.h"
#include "base/functional/callback_helpers.h"
#include "base/notreached.h"
#include "base/path_service.h"
#include "base/scoped_environment_variable_override.h"
#include "gpu/vulkan/vulkan_function_pointers.h"
#include "gpu/vulkan/vulkan_image.h"
#include "gpu/vulkan/vulkan_instance.h"
#include "gpu/vulkan/vulkan_surface.h"
#include "gpu/vulkan/vulkan_util.h"
#include "ui/gfx/gpu_fence.h"
#include "ui/gfx/gpu_memory_buffer.h"
#include "ui/ozone/platform/headless/vulkan_surface_headless.h"
#if BUILDFLAG(IS_FUCHSIA)
#include <lib/zx/channel.h>
#endif
namespace ui {
VulkanImplementationHeadless::VulkanImplementationHeadless(bool use_swiftshader)
: … { … }
bool VulkanImplementationHeadless::InitializeVulkanInstance(
bool using_surface) { … }
gpu::VulkanInstance* VulkanImplementationHeadless::GetVulkanInstance() { … }
std::unique_ptr<gpu::VulkanSurface>
VulkanImplementationHeadless::CreateViewSurface(gfx::AcceleratedWidget window) { … }
bool VulkanImplementationHeadless::GetPhysicalDevicePresentationSupport(
VkPhysicalDevice device,
const std::vector<VkQueueFamilyProperties>& queue_family_properties,
uint32_t queue_family_index) { … }
std::vector<const char*>
VulkanImplementationHeadless::GetRequiredDeviceExtensions() { … }
std::vector<const char*>
VulkanImplementationHeadless::GetOptionalDeviceExtensions() { … }
VkFence VulkanImplementationHeadless::CreateVkFenceForGpuFence(
VkDevice vk_device) { … }
std::unique_ptr<gfx::GpuFence>
VulkanImplementationHeadless::ExportVkFenceToGpuFence(VkDevice vk_device,
VkFence vk_fence) { … }
VkExternalSemaphoreHandleTypeFlagBits
VulkanImplementationHeadless::GetExternalSemaphoreHandleType() { … }
bool VulkanImplementationHeadless::CanImportGpuMemoryBuffer(
gpu::VulkanDeviceQueue* device_queue,
gfx::GpuMemoryBufferType memory_buffer_type) { … }
std::unique_ptr<gpu::VulkanImage>
VulkanImplementationHeadless::CreateImageFromGpuMemoryHandle(
gpu::VulkanDeviceQueue* device_queue,
gfx::GpuMemoryBufferHandle gmb_handle,
gfx::Size size,
VkFormat vk_format,
const gfx::ColorSpace& color_space) { … }
#if BUILDFLAG(IS_FUCHSIA)
void VulkanImplementationHeadless::RegisterSysmemBufferCollection(
VkDevice device,
zx::eventpair service_handle,
zx::channel sysmem_token,
gfx::BufferFormat format,
gfx::BufferUsage usage,
gfx::Size size,
size_t min_buffer_count,
bool register_with_image_pipe) {
NOTIMPLEMENTED();
}
#endif
}