blob: 588ee949cd73cb3e751f5b50f42b307ac2c86d4f [file] [log] [blame]
* Copyright 2015 Google Inc.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
#ifndef GrVkTransferBuffer_DEFINED
#define GrVkTransferBuffer_DEFINED
#include "GrBuffer.h"
#include "GrVkBuffer.h"
class GrVkGpu;
class GrVkTransferBuffer : public GrBuffer, public GrVkBuffer {
static GrVkTransferBuffer* Create(GrVkGpu* gpu, size_t size, GrVkBuffer::Type type);
void onAbandon() override;
void onRelease() override;
GrVkTransferBuffer(GrVkGpu* gpu, const GrVkBuffer::Desc& desc,
const GrVkBuffer::Resource* resource);
void setMemoryBacking(SkTraceMemoryDump* traceMemoryDump,
const SkString& dumpName) const override;
void onMap() override {
if (!this->wasDestroyed()) {
this->GrBuffer::fMapPtr = this->vkMap(this->getVkGpu());
void onUnmap() override {
if (!this->wasDestroyed()) {
bool onUpdateData(const void* src, size_t srcSizeInBytes) override {
SK_ABORT("Not implemented for transfer buffers.");
return false;
GrVkGpu* getVkGpu() const {
return reinterpret_cast<GrVkGpu*>(this->getGpu());
typedef GrBuffer INHERITED;