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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 const Desc& descriptor); | 72 const Desc& descriptor); |
73 | 73 |
74 GrVkBuffer(const Desc& desc, const GrVkBuffer::Resource* resource) | 74 GrVkBuffer(const Desc& desc, const GrVkBuffer::Resource* resource) |
75 : fDesc(desc), fResource(resource), fMapPtr(nullptr) { | 75 : fDesc(desc), fResource(resource), fMapPtr(nullptr) { |
76 } | 76 } |
77 | 77 |
78 void* vkMap(const GrVkGpu* gpu); | 78 void* vkMap(const GrVkGpu* gpu); |
79 void vkUnmap(const GrVkGpu* gpu); | 79 void vkUnmap(const GrVkGpu* gpu); |
80 // If the caller passes in a non null createdNewBuffer, this function will s
et the bool to true | 80 // If the caller passes in a non null createdNewBuffer, this function will s
et the bool to true |
81 // if it creates a new VkBuffer to upload the data to. | 81 // if it creates a new VkBuffer to upload the data to. |
82 bool vkUpdateData(const GrVkGpu* gpu, const void* src, size_t srcSizeInBytes
, | 82 bool vkUpdateData(GrVkGpu* gpu, const void* src, size_t srcSizeInBytes, |
83 bool* createdNewBuffer = nullptr); | 83 bool* createdNewBuffer = nullptr); |
84 | 84 |
85 void vkAbandon(); | 85 void vkAbandon(); |
86 void vkRelease(const GrVkGpu* gpu); | 86 void vkRelease(const GrVkGpu* gpu); |
87 | 87 |
88 private: | 88 private: |
89 void validate() const; | 89 void validate() const; |
90 bool vkIsMapped() const; | 90 bool vkIsMapped() const; |
91 | 91 |
92 Desc fDesc; | 92 Desc fDesc; |
93 const Resource* fResource; | 93 const Resource* fResource; |
94 void* fMapPtr; | 94 void* fMapPtr; |
95 | 95 |
96 typedef SkNoncopyable INHERITED; | 96 typedef SkNoncopyable INHERITED; |
97 }; | 97 }; |
98 | 98 |
99 #endif | 99 #endif |
OLD | NEW |