#include "ui/ozone/public/surface_factory_ozone.h"
#include <stdlib.h>
#include <memory>
#include "base/command_line.h"
#include "gpu/vulkan/buildflags.h"
#include "ui/gfx/native_pixmap.h"
#include "ui/gl/gl_implementation.h"
#include "ui/ozone/public/overlay_surface.h"
#include "ui/ozone/public/platform_window_surface.h"
#include "ui/ozone/public/surface_ozone_canvas.h"
#if BUILDFLAG(ENABLE_VULKAN)
#include "gpu/vulkan/vulkan_instance.h"
#endif
namespace ui {
SurfaceFactoryOzone::SurfaceFactoryOzone() { … }
SurfaceFactoryOzone::~SurfaceFactoryOzone() { … }
std::vector<gl::GLImplementationParts>
SurfaceFactoryOzone::GetAllowedGLImplementations() { … }
GLOzone* SurfaceFactoryOzone::GetGLOzone(
const gl::GLImplementationParts& implementation) { … }
GLOzone* SurfaceFactoryOzone::GetCurrentGLOzone() { … }
#if BUILDFLAG(ENABLE_VULKAN)
std::unique_ptr<gpu::VulkanImplementation>
SurfaceFactoryOzone::CreateVulkanImplementation(bool use_swiftshader,
bool allow_protected_memory) { … }
scoped_refptr<gfx::NativePixmap>
SurfaceFactoryOzone::CreateNativePixmapForVulkan(
gfx::AcceleratedWidget widget,
gfx::Size size,
gfx::BufferFormat format,
gfx::BufferUsage usage,
VkDevice vk_device,
VkDeviceMemory* vk_device_memory,
VkImage* vk_image) { … }
#endif
std::unique_ptr<PlatformWindowSurface>
SurfaceFactoryOzone::CreatePlatformWindowSurface(
gfx::AcceleratedWidget widget) { … }
std::unique_ptr<OverlaySurface> SurfaceFactoryOzone::CreateOverlaySurface(
gfx::AcceleratedWidget widget) { … }
std::unique_ptr<SurfaceOzoneCanvas> SurfaceFactoryOzone::CreateCanvasForWidget(
gfx::AcceleratedWidget widget) { … }
scoped_refptr<gfx::NativePixmap> SurfaceFactoryOzone::CreateNativePixmap(
gfx::AcceleratedWidget widget,
gpu::VulkanDeviceQueue* device_queue,
gfx::Size size,
gfx::BufferFormat format,
gfx::BufferUsage usage,
std::optional<gfx::Size> framebuffer_size) { … }
bool SurfaceFactoryOzone::CanCreateNativePixmapForFormat(
gfx::BufferFormat format) { … }
void SurfaceFactoryOzone::CreateNativePixmapAsync(
gfx::AcceleratedWidget widget,
gpu::VulkanDeviceQueue* device_queue,
gfx::Size size,
gfx::BufferFormat format,
gfx::BufferUsage usage,
NativePixmapCallback callback) { … }
scoped_refptr<gfx::NativePixmap>
SurfaceFactoryOzone::CreateNativePixmapFromHandle(
gfx::AcceleratedWidget widget,
gfx::Size size,
gfx::BufferFormat format,
gfx::NativePixmapHandle handle) { … }
scoped_refptr<gfx::NativePixmap>
SurfaceFactoryOzone::CreateNativePixmapForProtectedBufferHandle(
gfx::AcceleratedWidget widget,
gfx::Size size,
gfx::BufferFormat format,
gfx::NativePixmapHandle handle) { … }
void SurfaceFactoryOzone::SetGetProtectedNativePixmapDelegate(
const GetProtectedNativePixmapCallback&
get_protected_native_pixmap_callback) { … }
bool SurfaceFactoryOzone::SupportsDrmModifiersFilter() const { … }
void SurfaceFactoryOzone::SetDrmModifiersFilter(
std::unique_ptr<DrmModifiersFilter> filter) { … }
std::vector<gfx::BufferFormat>
SurfaceFactoryOzone::GetSupportedFormatsForTexturing() const { … }
std::optional<gfx::BufferFormat>
SurfaceFactoryOzone::GetPreferredFormatForSolidColor() const { … }
}