#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "gpu/command_buffer/client/implementation_base.h"
#include <algorithm>
#include "base/functional/bind.h"
#include "base/logging.h"
#include "base/strings/stringprintf.h"
#include "base/trace_event/memory_dump_manager.h"
#include "base/trace_event/trace_event.h"
#include "gpu/command_buffer/client/cmd_buffer_helper.h"
#include "gpu/command_buffer/client/gpu_control.h"
#include "gpu/command_buffer/client/mapped_memory.h"
#include "gpu/command_buffer/client/query_tracker.h"
#include "gpu/command_buffer/client/shared_memory_limits.h"
#include "gpu/command_buffer/common/sync_token.h"
namespace gpu {
const uint32_t ImplementationBase::kMaxSizeOfSimpleResult;
const uint32_t ImplementationBase::kStartingOffset;
ImplementationBase::ImplementationBase(CommandBufferHelper* helper,
TransferBufferInterface* transfer_buffer,
GpuControl* gpu_control)
: … { … }
ImplementationBase::~ImplementationBase() { … }
void ImplementationBase::FreeUnusedSharedMemory() { … }
void ImplementationBase::FreeEverything() { … }
void ImplementationBase::SetLostContextCallback(base::OnceClosure callback) { … }
void ImplementationBase::FlushPendingWork() { … }
void ImplementationBase::SignalSyncToken(const SyncToken& sync_token,
base::OnceClosure callback) { … }
bool ImplementationBase::IsSyncTokenSignaled(const SyncToken& sync_token) { … }
void ImplementationBase::GenSyncToken(GLbyte* sync_token) { … }
void ImplementationBase::GenUnverifiedSyncToken(GLbyte* sync_token) { … }
void ImplementationBase::VerifySyncTokens(GLbyte** sync_tokens, GLsizei count) { … }
void ImplementationBase::WaitSyncToken(const GLbyte* sync_token_data) { … }
void ImplementationBase::SignalQuery(uint32_t query,
base::OnceClosure callback) { … }
void ImplementationBase::GetGpuFence(
uint32_t gpu_fence_id,
base::OnceCallback<void(std::unique_ptr<gfx::GpuFence>)> callback) { … }
bool ImplementationBase::OnMemoryDump(
const base::trace_event::MemoryDumpArgs& args,
base::trace_event::ProcessMemoryDump* pmd) { … }
gpu::ContextResult ImplementationBase::Initialize(
const SharedMemoryLimits& limits) { … }
bool ImplementationBase::WaitForCmd() { … }
int32_t ImplementationBase::GetResultShmId() { … }
bool ImplementationBase::GetBucketContents(uint32_t bucket_id,
std::vector<int8_t>* data) { … }
void ImplementationBase::SetBucketContents(uint32_t bucket_id,
const void* data,
uint32_t size) { … }
void ImplementationBase::SetBucketAsCString(uint32_t bucket_id,
const char* str) { … }
bool ImplementationBase::GetBucketAsString(uint32_t bucket_id,
std::string* str) { … }
void ImplementationBase::SetBucketAsString(uint32_t bucket_id,
const std::string& str) { … }
bool ImplementationBase::GetVerifiedSyncTokenForIPC(
const SyncToken& sync_token,
SyncToken* verified_sync_token) { … }
void ImplementationBase::RunIfContextNotLost(base::OnceClosure callback) { … }
void ImplementationBase::SetGrContext(GrDirectContext* gr) { … }
bool ImplementationBase::HasGrContextSupport() const { … }
void ImplementationBase::WillCallGLFromSkia() { … }
void ImplementationBase::DidCallGLFromSkia() { … }
}