#include "ui/gfx/linux/gpu_memory_buffer_support_x11.h"
#include <fcntl.h>
#include <xcb/xcb.h>
#include <memory>
#include "base/containers/contains.h"
#include "base/debug/crash_logging.h"
#include "base/logging.h"
#include "base/no_destructor.h"
#include "base/posix/eintr_wrapper.h"
#include "ui/gfx/buffer_format_util.h"
#include "ui/gfx/buffer_types.h"
#include "ui/gfx/buffer_usage_util.h"
#include "ui/gfx/linux/drm_util_linux.h"
#include "ui/gfx/linux/gbm_buffer.h"
#include "ui/gfx/linux/gbm_device.h"
#include "ui/gfx/linux/gbm_util.h"
#include "ui/gfx/linux/gbm_wrapper.h"
#include "ui/gfx/x/connection.h"
#include "ui/gfx/x/dri3.h"
#include "ui/gfx/x/future.h"
namespace ui {
namespace {
std::unique_ptr<ui::GbmDevice> CreateX11GbmDevice() { … }
std::vector<gfx::BufferUsageAndFormat> CreateSupportedConfigList(
ui::GbmDevice* device) { … }
}
GpuMemoryBufferSupportX11* GpuMemoryBufferSupportX11::GetInstance() { … }
GpuMemoryBufferSupportX11::GpuMemoryBufferSupportX11()
: … { … }
GpuMemoryBufferSupportX11::~GpuMemoryBufferSupportX11() = default;
std::unique_ptr<GbmBuffer> GpuMemoryBufferSupportX11::CreateBuffer(
gfx::BufferFormat format,
const gfx::Size& size,
gfx::BufferUsage usage) { … }
bool GpuMemoryBufferSupportX11::CanCreateNativePixmapForFormat(
gfx::BufferFormat format) { … }
std::unique_ptr<GbmBuffer> GpuMemoryBufferSupportX11::CreateBufferFromHandle(
const gfx::Size& size,
gfx::BufferFormat format,
gfx::NativePixmapHandle handle) { … }
}