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 "GrDrawVerticesBatch.h" | 8 #include "GrDrawVerticesBatch.h" |
9 | 9 |
10 #include "GrBatchFlushState.h" | 10 #include "GrBatchFlushState.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 int firstVertex; | 127 int firstVertex; |
128 | 128 |
129 void* verts = target->makeVertexSpace(vertexStride, this->vertexCount(), | 129 void* verts = target->makeVertexSpace(vertexStride, this->vertexCount(), |
130 &vertexBuffer, &firstVertex); | 130 &vertexBuffer, &firstVertex); |
131 | 131 |
132 if (!verts) { | 132 if (!verts) { |
133 SkDebugf("Could not allocate vertices\n"); | 133 SkDebugf("Could not allocate vertices\n"); |
134 return; | 134 return; |
135 } | 135 } |
136 | 136 |
137 const GrIndexBuffer* indexBuffer = NULL; | 137 const GrIndexBuffer* indexBuffer = nullptr; |
138 int firstIndex = 0; | 138 int firstIndex = 0; |
139 | 139 |
140 uint16_t* indices = NULL; | 140 uint16_t* indices = nullptr; |
141 if (this->hasIndices()) { | 141 if (this->hasIndices()) { |
142 indices = target->makeIndexSpace(this->indexCount(), &indexBuffer, &firs
tIndex); | 142 indices = target->makeIndexSpace(this->indexCount(), &indexBuffer, &firs
tIndex); |
143 | 143 |
144 if (!indices) { | 144 if (!indices) { |
145 SkDebugf("Could not allocate indices\n"); | 145 SkDebugf("Could not allocate indices\n"); |
146 return; | 146 return; |
147 } | 147 } |
148 } | 148 } |
149 | 149 |
150 int indexOffset = 0; | 150 int indexOffset = 0; |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 geometry.fColor = GrRandomColor(random); | 340 geometry.fColor = GrRandomColor(random); |
341 return GrDrawVerticesBatch::Create(geometry, type, viewMatrix, | 341 return GrDrawVerticesBatch::Create(geometry, type, viewMatrix, |
342 positions.begin(), vertexCount, | 342 positions.begin(), vertexCount, |
343 indices.begin(), hasIndices ? vertexCount
: 0, | 343 indices.begin(), hasIndices ? vertexCount
: 0, |
344 colors.begin(), | 344 colors.begin(), |
345 texCoords.begin(), | 345 texCoords.begin(), |
346 bounds); | 346 bounds); |
347 } | 347 } |
348 | 348 |
349 #endif | 349 #endif |
OLD | NEW |