#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "gpu/command_buffer/client/test_gpu_memory_buffer_manager.h"
#include <stddef.h>
#include <stdint.h>
#include <utility>
#include "base/check_op.h"
#include "base/memory/raw_ptr.h"
#include "base/numerics/safe_conversions.h"
#include "ui/gfx/buffer_format_util.h"
#include "ui/gfx/gpu_memory_buffer.h"
namespace gpu {
namespace {
class GpuMemoryBufferImpl : public gfx::GpuMemoryBuffer { … };
class GpuMemoryBufferFromClient : public gfx::GpuMemoryBuffer { … };
}
TestGpuMemoryBufferManager::TestGpuMemoryBufferManager() { … }
TestGpuMemoryBufferManager::~TestGpuMemoryBufferManager() { … }
std::unique_ptr<TestGpuMemoryBufferManager>
TestGpuMemoryBufferManager::CreateClientGpuMemoryBufferManager() { … }
void TestGpuMemoryBufferManager::OnGpuMemoryBufferDestroyed(
gfx::GpuMemoryBufferId gpu_memory_buffer_id) { … }
std::unique_ptr<gfx::GpuMemoryBuffer>
TestGpuMemoryBufferManager::CreateGpuMemoryBuffer(
const gfx::Size& size,
gfx::BufferFormat format,
gfx::BufferUsage usage,
gpu::SurfaceHandle surface_handle,
base::WaitableEvent* shutdown_event) { … }
void TestGpuMemoryBufferManager::CopyGpuMemoryBufferAsync(
gfx::GpuMemoryBufferHandle buffer_handle,
base::UnsafeSharedMemoryRegion memory_region,
base::OnceCallback<void(bool)> callback) { … }
bool TestGpuMemoryBufferManager::CopyGpuMemoryBufferSync(
gfx::GpuMemoryBufferHandle buffer_handle,
base::UnsafeSharedMemoryRegion memory_region) { … }
}