chromium/gpu/command_buffer/common/buffer.cc

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

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "gpu/command_buffer/common/buffer.h"

#include <stddef.h>
#include <stdint.h>
#include <ostream>

#include "base/atomic_sequence_num.h"
#include "base/bits.h"
#include "base/check_op.h"
#include "base/format_macros.h"
#include "base/no_destructor.h"
#include "base/numerics/safe_math.h"
#include "base/strings/stringprintf.h"

namespace gpu {
namespace {

// Global atomic to generate unique buffer IDs.
base::AtomicSequenceNumber g_next_buffer_id;

}  // namespace

const base::UnsafeSharedMemoryRegion& BufferBacking::shared_memory_region()
    const {}

base::UnguessableToken BufferBacking::GetGUID() const {}

MemoryBufferBacking::MemoryBufferBacking(uint32_t size, uint32_t alignment)
    :{}

MemoryBufferBacking::~MemoryBufferBacking() = default;

void* MemoryBufferBacking::GetMemory() const {}

uint32_t MemoryBufferBacking::GetSize() const {}

SharedMemoryBufferBacking::SharedMemoryBufferBacking(
    base::UnsafeSharedMemoryRegion shared_memory_region,
    base::WritableSharedMemoryMapping shared_memory_mapping)
    :{}

SharedMemoryBufferBacking::~SharedMemoryBufferBacking() = default;

const base::UnsafeSharedMemoryRegion&
SharedMemoryBufferBacking::shared_memory_region() const {}

base::UnguessableToken SharedMemoryBufferBacking::GetGUID() const {}

void* SharedMemoryBufferBacking::GetMemory() const {}

uint32_t SharedMemoryBufferBacking::GetSize() const {}

Buffer::Buffer(std::unique_ptr<BufferBacking> backing)
    :{}

Buffer::~Buffer() = default;

void* Buffer::GetDataAddress(uint32_t data_offset, uint32_t data_size) const {}

void* Buffer::GetDataAddressAndSize(uint32_t data_offset,
                                    uint32_t* data_size) const {}

uint32_t Buffer::GetRemainingSize(uint32_t data_offset) const {}

int32_t GetNextBufferId() {}

base::trace_event::MemoryAllocatorDumpGuid GetBufferGUIDForTracing(
    uint64_t tracing_process_id,
    int32_t buffer_id) {}

} // namespace gpu