chromium/gpu/command_buffer/client/client_discardable_manager.cc

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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 {

// Stores a set of offsets, initially 0 to |element_count_|. Allows callers to
// take and return offsets from the set. Internally stores the offsets as a set
// of ranges. This means that in the worst case (every other offset taken), the
// set will use |element_count_| uints, but should typically use fewer.
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) {}

// Returns the size of the allocation which ClientDiscardableManager will
// sub-allocate from. This should be at least as big as the minimum shared
// memory allocation size.
size_t AllocationSize() {}

ClientDiscardableHandle::Id GetNextHandleId() {}

}  // namespace

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) {}

}  // namespace gpu