Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(322)

Unified Diff: src/gpu/vk/GrVkTransferBuffer.h

Issue 1825393002: Consolidate GPU buffer implementations (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: asserts Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/vk/GrVkIndexBuffer.cpp ('k') | src/gpu/vk/GrVkTransferBuffer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkTransferBuffer.h
diff --git a/src/gpu/vk/GrVkTransferBuffer.h b/src/gpu/vk/GrVkTransferBuffer.h
index f978df95fd744cf7cc14138c35e1e544e96c5e24..c6ca2147b38b1caa08ceed5c7892bf4c25fef497 100644
--- a/src/gpu/vk/GrVkTransferBuffer.h
+++ b/src/gpu/vk/GrVkTransferBuffer.h
@@ -8,13 +8,13 @@
#ifndef GrVkTransferBuffer_DEFINED
#define GrVkTransferBuffer_DEFINED
-#include "GrTransferBuffer.h"
+#include "GrBuffer.h"
#include "GrVkBuffer.h"
#include "vk/GrVkInterface.h"
class GrVkGpu;
-class GrVkTransferBuffer : public GrTransferBuffer, public GrVkBuffer {
+class GrVkTransferBuffer : public GrBuffer, public GrVkBuffer {
public:
static GrVkTransferBuffer* Create(GrVkGpu* gpu, size_t size, GrVkBuffer::Type type);
@@ -29,11 +29,9 @@ private:
void setMemoryBacking(SkTraceMemoryDump* traceMemoryDump,
const SkString& dumpName) const override;
- void* onMap() override {
+ void onMap() override {
if (!this->wasDestroyed()) {
- return this->vkMap(this->getVkGpu());
- } else {
- return nullptr;
+ this->GrBuffer::fMapPtr = this->vkMap(this->getVkGpu());
}
}
@@ -43,12 +41,17 @@ private:
}
}
+ bool onUpdateData(const void* src, size_t srcSizeInBytes) override {
+ SkFAIL("Not implemented for transfer buffers.");
+ return false;
+ }
+
GrVkGpu* getVkGpu() const {
SkASSERT(!this->wasDestroyed());
return reinterpret_cast<GrVkGpu*>(this->getGpu());
}
- typedef GrTransferBuffer INHERITED;
+ typedef GrBuffer INHERITED;
};
#endif
« no previous file with comments | « src/gpu/vk/GrVkIndexBuffer.cpp ('k') | src/gpu/vk/GrVkTransferBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698