OLD | NEW |
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 GrVkVertexBuffer_DEFINED | 8 #ifndef GrVkVertexBuffer_DEFINED |
9 #define GrVkVertexBuffer_DEFINED | 9 #define GrVkVertexBuffer_DEFINED |
10 | 10 |
11 #include "GrVertexBuffer.h" | 11 #include "GrBuffer.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 GrVkVertexBuffer : public GrVertexBuffer, public GrVkBuffer { | 17 class GrVkVertexBuffer : public GrBuffer, public GrVkBuffer { |
18 public: | 18 public: |
19 static GrVkVertexBuffer* Create(GrVkGpu* gpu, size_t size, bool dynamic); | 19 static GrVkVertexBuffer* Create(GrVkGpu* gpu, size_t size, bool dynamic); |
20 | 20 |
21 protected: | 21 protected: |
22 void onAbandon() override; | 22 void onAbandon() override; |
23 void onRelease() override; | 23 void onRelease() override; |
24 | 24 |
25 private: | 25 private: |
26 GrVkVertexBuffer(GrVkGpu* gpu, const GrVkBuffer::Desc& desc, | 26 GrVkVertexBuffer(GrVkGpu* gpu, const GrVkBuffer::Desc& desc, |
27 const GrVkBuffer::Resource* resource); | 27 const GrVkBuffer::Resource* resource); |
28 | 28 |
29 void* onMap() override; | 29 void onMap() override; |
30 void onUnmap() override; | 30 void onUnmap() override; |
31 bool onUpdateData(const void* src, size_t srcSizeInBytes) override; | 31 bool onUpdateData(const void* src, size_t srcSizeInBytes) override; |
32 | 32 |
33 GrVkGpu* getVkGpu() const; | 33 GrVkGpu* getVkGpu() const; |
34 | 34 |
35 typedef GrVertexBuffer INHERITED; | 35 typedef GrBuffer INHERITED; |
36 }; | 36 }; |
37 | 37 |
38 #endif | 38 #endif |
OLD | NEW |