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

Side by Side Diff: src/gpu/vk/GrVkTransferBuffer.h

Issue 1831133004: Revert of Consolidate GPU buffer implementations (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « src/gpu/vk/GrVkIndexBuffer.cpp ('k') | src/gpu/vk/GrVkTransferBuffer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef GrVkTransferBuffer_DEFINED 8 #ifndef GrVkTransferBuffer_DEFINED
9 #define GrVkTransferBuffer_DEFINED 9 #define GrVkTransferBuffer_DEFINED
10 10
11 #include "GrBuffer.h" 11 #include "GrTransferBuffer.h"
12 #include "GrVkBuffer.h" 12 #include "GrVkBuffer.h"
13 #include "vk/GrVkInterface.h" 13 #include "vk/GrVkInterface.h"
14 14
15 class GrVkGpu; 15 class GrVkGpu;
16 16
17 class GrVkTransferBuffer : public GrBuffer, public GrVkBuffer { 17 class GrVkTransferBuffer : public GrTransferBuffer, public GrVkBuffer {
18 18
19 public: 19 public:
20 static GrVkTransferBuffer* Create(GrVkGpu* gpu, size_t size, GrVkBuffer::Typ e type); 20 static GrVkTransferBuffer* Create(GrVkGpu* gpu, size_t size, GrVkBuffer::Typ e type);
21 21
22 protected: 22 protected:
23 void onAbandon() override; 23 void onAbandon() override;
24 void onRelease() override; 24 void onRelease() override;
25 25
26 private: 26 private:
27 GrVkTransferBuffer(GrVkGpu* gpu, const GrVkBuffer::Desc& desc, 27 GrVkTransferBuffer(GrVkGpu* gpu, const GrVkBuffer::Desc& desc,
28 const GrVkBuffer::Resource* resource); 28 const GrVkBuffer::Resource* resource);
29 void setMemoryBacking(SkTraceMemoryDump* traceMemoryDump, 29 void setMemoryBacking(SkTraceMemoryDump* traceMemoryDump,
30 const SkString& dumpName) const override; 30 const SkString& dumpName) const override;
31 31
32 void onMap() override { 32 void* onMap() override {
33 if (!this->wasDestroyed()) { 33 if (!this->wasDestroyed()) {
34 this->GrBuffer::fMapPtr = this->vkMap(this->getVkGpu()); 34 return this->vkMap(this->getVkGpu());
35 } else {
36 return nullptr;
35 } 37 }
36 } 38 }
37 39
38 void onUnmap() override { 40 void onUnmap() override {
39 if (!this->wasDestroyed()) { 41 if (!this->wasDestroyed()) {
40 this->vkUnmap(this->getVkGpu()); 42 this->vkUnmap(this->getVkGpu());
41 } 43 }
42 } 44 }
43 45
44 bool onUpdateData(const void* src, size_t srcSizeInBytes) override {
45 SkFAIL("Not implemented for transfer buffers.");
46 return false;
47 }
48
49 GrVkGpu* getVkGpu() const { 46 GrVkGpu* getVkGpu() const {
50 SkASSERT(!this->wasDestroyed()); 47 SkASSERT(!this->wasDestroyed());
51 return reinterpret_cast<GrVkGpu*>(this->getGpu()); 48 return reinterpret_cast<GrVkGpu*>(this->getGpu());
52 } 49 }
53 50
54 typedef GrBuffer INHERITED; 51 typedef GrTransferBuffer INHERITED;
55 }; 52 };
56 53
57 #endif 54 #endif
OLDNEW
« 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