1 /* 2 * Copyright 2015 Google Inc. 3 * 4 * Use of this source code is governed by a BSD-style license that can be 5 * found in the LICENSE file. 6 */ 7 8 #ifndef GrVkVertexBuffer_DEFINED 9 #define GrVkVertexBuffer_DEFINED 10 11 #include "GrBuffer.h" 12 #include "GrVkBuffer.h" 13 14 class GrVkGpu; 15 16 class GrVkVertexBuffer : public GrBuffer, public GrVkBuffer { 17 public: 18 static sk_sp<GrVkVertexBuffer> Make(GrVkGpu* gpu, size_t size, bool dynamic); 19 20 protected: 21 void onAbandon() override; 22 void onRelease() override; 23 24 private: 25 GrVkVertexBuffer(GrVkGpu* gpu, const GrVkBuffer::Desc& desc, 26 const GrVkBuffer::Resource* resource); 27 28 void onMap() override; 29 void onUnmap() override; 30 bool onUpdateData(const void* src, size_t srcSizeInBytes) override; 31 32 GrVkGpu* getVkGpu() const; 33 34 typedef GrBuffer INHERITED; 35 }; 36 37 #endif 38