| 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 GrVkBuffer_DEFINED | 8 #ifndef GrVkBuffer_DEFINED |
| 9 #define GrVkBuffer_DEFINED | 9 #define GrVkBuffer_DEFINED |
| 10 | 10 |
| 11 #include "GrVkResource.h" | 11 #include "GrVkResource.h" |
| 12 #include "vk/GrVkDefines.h" | 12 #include "vk/GrVkDefines.h" |
| 13 #include "vk/GrVkTypes.h" | 13 #include "vk/GrVkTypes.h" |
| 14 | 14 |
| 15 class GrVkGpu; | 15 class GrVkGpu; |
| 16 | 16 |
| 17 /** | 17 /** |
| 18 * This class serves as the base of GrVk*Buffer classes. It was written to avoid
code | 18 * This class serves as the base of GrVk*Buffer classes. It was written to avoid
code |
| 19 * duplication in those classes. | 19 * duplication in those classes. |
| 20 */ | 20 */ |
| 21 class GrVkBuffer : public SkNoncopyable { | 21 class GrVkBuffer : public SkNoncopyable { |
| 22 public: | 22 public: |
| 23 ~GrVkBuffer() { | 23 virtual ~GrVkBuffer() { |
| 24 // either release or abandon should have been called by the owner of thi
s object. | 24 // either release or abandon should have been called by the owner of thi
s object. |
| 25 SkASSERT(!fResource); | 25 SkASSERT(!fResource); |
| 26 } | 26 } |
| 27 | 27 |
| 28 VkBuffer buffer() const { return fResource->fBuffer; } | 28 VkBuffer buffer() const { return fResource->fBuffer; } |
| 29 const GrVkAlloc& alloc() const { return fResource->fAlloc; } | 29 const GrVkAlloc& alloc() const { return fResource->fAlloc; } |
| 30 const GrVkRecycledResource* resource() const { return fResource; } | 30 const GrVkRecycledResource* resource() const { return fResource; } |
| 31 size_t size() const { return fDesc.fSizeInBytes; } | 31 size_t size() const { return fDesc.fSizeInBytes; } |
| 32 VkDeviceSize offset() const { return fOffset; } | 32 VkDeviceSize offset() const { return fOffset; } |
| 33 | 33 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 104 |
| 105 Desc fDesc; | 105 Desc fDesc; |
| 106 const Resource* fResource; | 106 const Resource* fResource; |
| 107 VkDeviceSize fOffset; | 107 VkDeviceSize fOffset; |
| 108 void* fMapPtr; | 108 void* fMapPtr; |
| 109 | 109 |
| 110 typedef SkNoncopyable INHERITED; | 110 typedef SkNoncopyable INHERITED; |
| 111 }; | 111 }; |
| 112 | 112 |
| 113 #endif | 113 #endif |
| OLD | NEW |