chromium/cc/raster/staging_buffer_pool.cc

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

#include "cc/raster/staging_buffer_pool.h"

#include <memory>
#include <string>
#include <utility>

#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/ranges/algorithm.h"
#include "base/strings/stringprintf.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/single_thread_task_runner.h"
#include "base/trace_event/memory_dump_manager.h"
#include "cc/base/container_util.h"
#include "components/viz/common/gpu/raster_context_provider.h"
#include "components/viz/common/resources/resource_sizes.h"
#include "gpu/command_buffer/client/context_support.h"
#include "gpu/command_buffer/client/raster_interface.h"
#include "gpu/command_buffer/client/shared_image_interface.h"
#include "third_party/khronos/GLES2/gl2.h"
#include "third_party/khronos/GLES2/gl2ext.h"

MemoryAllocatorDump;
MemoryAllocatorDumpGuid;
MemoryDumpLevelOfDetail;

namespace cc {
namespace {

// Delay between checking for query result to be available.
const int kCheckForQueryResultAvailableTickRateMs =;

// Number of attempts to allow before we perform a check that will wait for
// query to complete.
const int kMaxCheckForQueryResultAvailableAttempts =;

// Delay before a staging buffer might be released.
const int kStagingBufferExpirationDelayMs =;

bool CheckForQueryResult(gpu::raster::RasterInterface* ri, GLuint query_id) {}

void WaitForQueryResult(gpu::raster::RasterInterface* ri, GLuint query_id) {}

}  // namespace

StagingBuffer::StagingBuffer(const gfx::Size& size,
                             viz::SharedImageFormat format)
    :{}

StagingBuffer::~StagingBuffer() {}

void StagingBuffer::DestroyGLResources(gpu::raster::RasterInterface* ri,
                                       gpu::SharedImageInterface* sii) {}

void StagingBuffer::OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd,
                                 viz::SharedImageFormat dump_format,
                                 bool in_free_list) const {}

StagingBufferPool::StagingBufferPool(
    scoped_refptr<base::SequencedTaskRunner> task_runner,
    viz::RasterContextProvider* worker_context_provider,
    bool use_partial_raster,
    int max_staging_buffer_usage_in_bytes)
    :{}

StagingBufferPool::~StagingBufferPool() {}

void StagingBufferPool::Shutdown() {}

void StagingBufferPool::ReleaseStagingBuffer(
    std::unique_ptr<StagingBuffer> staging_buffer) {}

bool StagingBufferPool::OnMemoryDump(
    const base::trace_event::MemoryDumpArgs& args,
    base::trace_event::ProcessMemoryDump* pmd) {}

void StagingBufferPool::AddStagingBuffer(const StagingBuffer* staging_buffer,
                                         viz::SharedImageFormat format) {}

void StagingBufferPool::RemoveStagingBuffer(
    const StagingBuffer* staging_buffer) {}

void StagingBufferPool::MarkStagingBufferAsFree(
    const StagingBuffer* staging_buffer) {}

void StagingBufferPool::MarkStagingBufferAsBusy(
    const StagingBuffer* staging_buffer) {}

std::unique_ptr<StagingBuffer> StagingBufferPool::AcquireStagingBuffer(
    const gfx::Size& size,
    viz::SharedImageFormat format,
    uint64_t previous_content_id) {}

base::TimeTicks StagingBufferPool::GetUsageTimeForLRUBuffer() {}

void StagingBufferPool::ScheduleReduceMemoryUsage() {}

void StagingBufferPool::ReduceMemoryUsage() {}

void StagingBufferPool::ReleaseBuffersNotUsedSince(base::TimeTicks time) {}

void StagingBufferPool::OnMemoryPressure(
    base::MemoryPressureListener::MemoryPressureLevel level) {}

}  // namespace cc