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 GrVkIndexBuffer_DEFINED
9 #define GrVkIndexBuffer_DEFINED
10 
11 #include "src/gpu/GrGpuBuffer.h"
12 #include "src/gpu/vk/GrVkBuffer.h"
13 
14 class GrVkGpu;
15 
16 class GrVkIndexBuffer : public GrGpuBuffer, public GrVkBuffer {
17 public:
18     static sk_sp<GrVkIndexBuffer> Make(GrVkGpu* gpu, size_t size, bool dynamic);
19 
20 protected:
21     void onAbandon() override;
22     void onRelease() override;
23 
24 private:
25     GrVkIndexBuffer(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 GrGpuBuffer INHERITED;
35 };
36 
37 #endif
38