Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(390)

Side by Side Diff: src/gpu/batches/GrDefaultPathRenderer.cpp

Issue 1825393002: Consolidate GPU buffer implementations (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: asserts Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/batches/GrAtlasTextBatch.cpp ('k') | src/gpu/batches/GrDrawVerticesBatch.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/gpu/batches/GrAtlasTextBatch.cpp ('k') | src/gpu/batches/GrDrawVerticesBatch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698