#include "gpu/command_buffer/client/client_discardable_manager.h"
#include "base/atomic_sequence_num.h"
#include "base/containers/contains.h"
#include "base/containers/flat_set.h"
#include "base/numerics/safe_conversions.h"
#include "base/system/sys_info.h"
#include "build/build_config.h"
namespace gpu {
namespace {
class FreeOffsetSet { … };
FreeOffsetSet::FreeOffsetSet(uint32_t element_count)
: … { … }
bool FreeOffsetSet::HasFreeOffset() const { … }
bool FreeOffsetSet::HasUsedOffset() const { … }
uint32_t FreeOffsetSet::TakeFreeOffset() { … }
void FreeOffsetSet::ReturnFreeOffset(uint32_t offset) { … }
size_t AllocationSize() { … }
ClientDiscardableHandle::Id GetNextHandleId() { … }
}
struct ClientDiscardableManager::Allocation { … };
ClientDiscardableManager::ClientDiscardableManager()
: … { … }
ClientDiscardableManager::~ClientDiscardableManager() = default;
ClientDiscardableHandle::Id ClientDiscardableManager::CreateHandle(
CommandBuffer* command_buffer) { … }
bool ClientDiscardableManager::LockHandle(
ClientDiscardableHandle::Id handle_id) { … }
void ClientDiscardableManager::FreeHandle(
ClientDiscardableHandle::Id handle_id) { … }
bool ClientDiscardableManager::HandleIsValid(
ClientDiscardableHandle::Id handle_id) const { … }
ClientDiscardableHandle ClientDiscardableManager::GetHandle(
ClientDiscardableHandle::Id handle_id) { … }
bool ClientDiscardableManager::HandleIsDeleted(
ClientDiscardableHandle::Id handle_id) { … }
bool ClientDiscardableManager::HandleIsDeletedForTracing(
ClientDiscardableHandle::Id handle_id) const { … }
bool ClientDiscardableManager::FindAllocation(CommandBuffer* command_buffer,
scoped_refptr<Buffer>* buffer,
int32_t* shm_id,
uint32_t* offset) { … }
bool ClientDiscardableManager::FindExistingAllocation(
CommandBuffer* command_buffer,
scoped_refptr<Buffer>* buffer,
int32_t* shm_id,
uint32_t* offset) { … }
void ClientDiscardableManager::ReturnAllocation(
CommandBuffer* command_buffer,
const ClientDiscardableHandle& handle) { … }
void ClientDiscardableManager::CheckPending(CommandBuffer* command_buffer) { … }
bool ClientDiscardableManager::CheckDeleted(CommandBuffer* command_buffer) { … }
}