#ifndef GPU_COMMAND_BUFFER_COMMON_BUFFER_H_
#define GPU_COMMAND_BUFFER_COMMON_BUFFER_H_
#include <stddef.h>
#include <stdint.h>
#include <memory>
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h"
#include "base/memory/unsafe_shared_memory_region.h"
#include "base/trace_event/memory_allocator_dump.h"
#include "gpu/gpu_export.h"
namespace gpu {
class GPU_EXPORT BufferBacking { … };
class GPU_EXPORT MemoryBufferBacking : public BufferBacking { … };
class GPU_EXPORT SharedMemoryBufferBacking : public BufferBacking { … };
class GPU_EXPORT Buffer : public base::RefCountedThreadSafe<Buffer> { … };
inline std::unique_ptr<BufferBacking> MakeBackingFromSharedMemory(
base::UnsafeSharedMemoryRegion shared_memory_region,
base::WritableSharedMemoryMapping shared_memory_mapping) { … }
inline scoped_refptr<Buffer> MakeBufferFromSharedMemory(
base::UnsafeSharedMemoryRegion shared_memory_region,
base::WritableSharedMemoryMapping shared_memory_mapping) { … }
inline scoped_refptr<Buffer> MakeMemoryBuffer(uint32_t size,
uint32_t alignment = 0) { … }
GPU_EXPORT int32_t GetNextBufferId();
GPU_EXPORT base::trace_event::MemoryAllocatorDumpGuid GetBufferGUIDForTracing(
uint64_t tracing_process_id,
int32_t buffer_id);
}
#endif