#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "gpu/command_buffer/client/transfer_buffer.h"
#include <stddef.h>
#include <stdint.h>
#include <climits>
#include "base/bits.h"
#include "base/check_op.h"
#include "base/trace_event/trace_event.h"
#include "gpu/command_buffer/client/cmd_buffer_helper.h"
namespace gpu {
TransferBuffer::TransferBuffer(CommandBufferHelper* helper)
: … { … }
TransferBuffer::~TransferBuffer() { … }
base::UnguessableToken TransferBuffer::shared_memory_guid() const { … }
bool TransferBuffer::Initialize(unsigned int default_buffer_size,
unsigned int result_size,
unsigned int min_buffer_size,
unsigned int max_buffer_size,
unsigned int alignment) { … }
void TransferBuffer::Free() { … }
bool TransferBuffer::HaveBuffer() const { … }
RingBuffer::Offset TransferBuffer::GetOffset(void* pointer) const { … }
void TransferBuffer::DiscardBlock(void* p) { … }
void TransferBuffer::FreePendingToken(void* p, unsigned int token) { … }
unsigned int TransferBuffer::GetSize() const { … }
unsigned int TransferBuffer::GetFreeSize() const { … }
unsigned int TransferBuffer::GetFragmentedFreeSize() const { … }
void TransferBuffer::ShrinkLastBlock(unsigned int new_size) { … }
unsigned int TransferBuffer::GetMaxSize() const { … }
void TransferBuffer::AllocateRingBuffer(unsigned int size) { … }
static unsigned int ComputePOTSize(unsigned int dimension) { … }
void TransferBuffer::ReallocateRingBuffer(unsigned int size, bool shrink) { … }
unsigned int TransferBuffer::GetPreviousRingBufferUsedBytes() { … }
void TransferBuffer::ShrinkOrExpandRingBufferIfNecessary(
unsigned int size_to_allocate) { … }
void* TransferBuffer::AllocUpTo(
unsigned int size, unsigned int* size_allocated) { … }
void* TransferBuffer::Alloc(unsigned int size) { … }
void* TransferBuffer::AcquireResultBuffer() { … }
void TransferBuffer::ReleaseResultBuffer() { … }
int TransferBuffer::GetResultOffset() { … }
int TransferBuffer::GetShmId() { … }
unsigned int TransferBuffer::GetCurrentMaxAllocationWithoutRealloc() const { … }
ScopedTransferBufferPtr::ScopedTransferBufferPtr(
ScopedTransferBufferPtr&& other)
: … { … }
void ScopedTransferBufferPtr::Release() { … }
void ScopedTransferBufferPtr::Discard() { … }
void ScopedTransferBufferPtr::Reset(unsigned int new_size) { … }
void ScopedTransferBufferPtr::Shrink(unsigned int new_size) { … }
bool ScopedTransferBufferPtr::BelongsToBuffer(uint8_t* memory) const { … }
}