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 #include "GrVkGpu.h" | 8 #include "GrVkGpu.h" |
9 | 9 |
10 #include "GrContextOptions.h" | 10 #include "GrContextOptions.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 | 173 |
174 /////////////////////////////////////////////////////////////////////////////// | 174 /////////////////////////////////////////////////////////////////////////////// |
175 GrBuffer* GrVkGpu::onCreateBuffer(size_t size, GrBufferType type, GrAccessPatter
n accessPattern, | 175 GrBuffer* GrVkGpu::onCreateBuffer(size_t size, GrBufferType type, GrAccessPatter
n accessPattern, |
176 const void* data) { | 176 const void* data) { |
177 GrBuffer* buff; | 177 GrBuffer* buff; |
178 switch (type) { | 178 switch (type) { |
179 case kVertex_GrBufferType: | 179 case kVertex_GrBufferType: |
180 SkASSERT(kDynamic_GrAccessPattern == accessPattern || | 180 SkASSERT(kDynamic_GrAccessPattern == accessPattern || |
181 kStatic_GrAccessPattern == accessPattern); | 181 kStatic_GrAccessPattern == accessPattern); |
182 buff = GrVkVertexBuffer::Create(this, size, kDynamic_GrAccessPattern
== accessPattern); | 182 buff = GrVkVertexBuffer::Create(this, size, kDynamic_GrAccessPattern
== accessPattern); |
| 183 break; |
183 case kIndex_GrBufferType: | 184 case kIndex_GrBufferType: |
184 SkASSERT(kDynamic_GrAccessPattern == accessPattern || | 185 SkASSERT(kDynamic_GrAccessPattern == accessPattern || |
185 kStatic_GrAccessPattern == accessPattern); | 186 kStatic_GrAccessPattern == accessPattern); |
186 buff = GrVkIndexBuffer::Create(this, size, kDynamic_GrAccessPattern
== accessPattern); | 187 buff = GrVkIndexBuffer::Create(this, size, kDynamic_GrAccessPattern
== accessPattern); |
| 188 break; |
187 case kXferCpuToGpu_GrBufferType: | 189 case kXferCpuToGpu_GrBufferType: |
188 SkASSERT(kStream_GrAccessPattern == accessPattern); | 190 SkASSERT(kStream_GrAccessPattern == accessPattern); |
189 buff = GrVkTransferBuffer::Create(this, size, GrVkBuffer::kCopyRead_
Type); | 191 buff = GrVkTransferBuffer::Create(this, size, GrVkBuffer::kCopyRead_
Type); |
| 192 break; |
190 case kXferGpuToCpu_GrBufferType: | 193 case kXferGpuToCpu_GrBufferType: |
191 SkASSERT(kStream_GrAccessPattern == accessPattern); | 194 SkASSERT(kStream_GrAccessPattern == accessPattern); |
192 buff = GrVkTransferBuffer::Create(this, size, GrVkBuffer::kCopyWrite
_Type); | 195 buff = GrVkTransferBuffer::Create(this, size, GrVkBuffer::kCopyWrite
_Type); |
| 196 break; |
193 default: | 197 default: |
194 SkFAIL("Unknown buffer type."); | 198 SkFAIL("Unknown buffer type."); |
195 return nullptr; | 199 return nullptr; |
196 } | 200 } |
197 if (data && buff) { | 201 if (data && buff) { |
198 buff->updateData(data, size); | 202 buff->updateData(data, size); |
199 } | 203 } |
200 return buff; | 204 return buff; |
201 } | 205 } |
202 | 206 |
(...skipping 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1586 aglSwapBuffers(aglGetCurrentContext()); | 1590 aglSwapBuffers(aglGetCurrentContext()); |
1587 int set_a_break_pt_here = 9; | 1591 int set_a_break_pt_here = 9; |
1588 aglSwapBuffers(aglGetCurrentContext()); | 1592 aglSwapBuffers(aglGetCurrentContext()); |
1589 #elif defined(SK_BUILD_FOR_WIN32) | 1593 #elif defined(SK_BUILD_FOR_WIN32) |
1590 SwapBuf(); | 1594 SwapBuf(); |
1591 int set_a_break_pt_here = 9; | 1595 int set_a_break_pt_here = 9; |
1592 SwapBuf(); | 1596 SwapBuf(); |
1593 #endif | 1597 #endif |
1594 #endif | 1598 #endif |
1595 } | 1599 } |
OLD | NEW |