1 /* 2 * Copyright 2017 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 GrVkTexelBuffer_DEFINED 9 #define GrVkTexelBuffer_DEFINED 10 11 #include "GrBuffer.h" 12 #include "GrVkBuffer.h" 13 14 class GrVkGpu; 15 16 class GrVkTexelBuffer : public GrBuffer, public GrVkBuffer { 17 public: 18 static GrVkTexelBuffer* Create(GrVkGpu* gpu, size_t size, bool dynamic); 19 20 protected: 21 void onAbandon() override; 22 void onRelease() override; 23 24 private: 25 GrVkTexelBuffer(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