| 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 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 size_t fSizeInBytes; | 50 size_t fSizeInBytes; |
| 51 Type fType; // vertex buffer, index buffer, etc. | 51 Type fType; // vertex buffer, index buffer, etc. |
| 52 bool fDynamic; | 52 bool fDynamic; |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 class Resource : public GrVkResource { | 55 class Resource : public GrVkResource { |
| 56 public: | 56 public: |
| 57 Resource(VkBuffer buf, const GrVkAlloc& alloc, Type type) | 57 Resource(VkBuffer buf, const GrVkAlloc& alloc, Type type) |
| 58 : INHERITED(), fBuffer(buf), fAlloc(alloc), fType(type) {} | 58 : INHERITED(), fBuffer(buf), fAlloc(alloc), fType(type) {} |
| 59 | 59 |
| 60 #ifdef SK_TRACE_VK_RESOURCES |
| 61 void dumpInfo() const override { |
| 62 SkDebugf("GrVkBuffer: %d (%d refs)\n", fBuffer, this->getRefCnt()); |
| 63 } |
| 64 #endif |
| 60 VkBuffer fBuffer; | 65 VkBuffer fBuffer; |
| 61 GrVkAlloc fAlloc; | 66 GrVkAlloc fAlloc; |
| 62 Type fType; | 67 Type fType; |
| 63 | 68 |
| 64 private: | 69 private: |
| 65 void freeGPUData(const GrVkGpu* gpu) const; | 70 void freeGPUData(const GrVkGpu* gpu) const; |
| 66 | 71 |
| 67 typedef GrVkResource INHERITED; | 72 typedef GrVkResource INHERITED; |
| 68 }; | 73 }; |
| 69 | 74 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 90 bool vkIsMapped() const; | 95 bool vkIsMapped() const; |
| 91 | 96 |
| 92 Desc fDesc; | 97 Desc fDesc; |
| 93 const Resource* fResource; | 98 const Resource* fResource; |
| 94 void* fMapPtr; | 99 void* fMapPtr; |
| 95 | 100 |
| 96 typedef SkNoncopyable INHERITED; | 101 typedef SkNoncopyable INHERITED; |
| 97 }; | 102 }; |
| 98 | 103 |
| 99 #endif | 104 #endif |
| OLD | NEW |