OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 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 "GrDefaultPathRenderer.h" | 8 #include "GrDefaultPathRenderer.h" |
9 | 9 |
10 #include "GrBatchFlushState.h" | 10 #include "GrBatchFlushState.h" |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 } else { | 306 } else { |
307 if (isIndexed) { | 307 if (isIndexed) { |
308 maxIndices = 3 * maxVertices; | 308 maxIndices = 3 * maxVertices; |
309 primitiveType = kTriangles_GrPrimitiveType; | 309 primitiveType = kTriangles_GrPrimitiveType; |
310 } else { | 310 } else { |
311 primitiveType = kTriangleFan_GrPrimitiveType; | 311 primitiveType = kTriangleFan_GrPrimitiveType; |
312 } | 312 } |
313 } | 313 } |
314 | 314 |
315 // allocate vertex / index buffers | 315 // allocate vertex / index buffers |
316 const GrVertexBuffer* vertexBuffer; | 316 const GrBuffer* vertexBuffer; |
317 int firstVertex; | 317 int firstVertex; |
318 | 318 |
319 void* verts = target->makeVertexSpace(vertexStride, maxVertices, | 319 void* verts = target->makeVertexSpace(vertexStride, maxVertices, |
320 &vertexBuffer, &firstVertex); | 320 &vertexBuffer, &firstVertex); |
321 | 321 |
322 if (!verts) { | 322 if (!verts) { |
323 SkDebugf("Could not allocate vertices\n"); | 323 SkDebugf("Could not allocate vertices\n"); |
324 return; | 324 return; |
325 } | 325 } |
326 | 326 |
327 const GrIndexBuffer* indexBuffer = nullptr; | 327 const GrBuffer* indexBuffer = nullptr; |
328 int firstIndex = 0; | 328 int firstIndex = 0; |
329 | 329 |
330 void* indices = nullptr; | 330 void* indices = nullptr; |
331 if (isIndexed) { | 331 if (isIndexed) { |
332 indices = target->makeIndexSpace(maxIndices, &indexBuffer, &firstInd
ex); | 332 indices = target->makeIndexSpace(maxIndices, &indexBuffer, &firstInd
ex); |
333 | 333 |
334 if (!indices) { | 334 if (!indices) { |
335 SkDebugf("Could not allocate indices\n"); | 335 SkDebugf("Could not allocate indices\n"); |
336 return; | 336 return; |
337 } | 337 } |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
769 geometry.fColor = color; | 769 geometry.fColor = color; |
770 geometry.fPath = path; | 770 geometry.fPath = path; |
771 geometry.fTolerance = srcSpaceTol; | 771 geometry.fTolerance = srcSpaceTol; |
772 | 772 |
773 viewMatrix.mapRect(&bounds); | 773 viewMatrix.mapRect(&bounds); |
774 uint8_t coverage = GrRandomCoverage(random); | 774 uint8_t coverage = GrRandomCoverage(random); |
775 return DefaultPathBatch::Create(geometry, coverage, viewMatrix, true, bounds
); | 775 return DefaultPathBatch::Create(geometry, coverage, viewMatrix, true, bounds
); |
776 } | 776 } |
777 | 777 |
778 #endif | 778 #endif |
OLD | NEW |