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

Side by Side Diff: src/gpu/GrTessellatingPathRenderer.cpp

Issue 1131553002: Isolate GrBufferAllocPools inside GrBatchTarget (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update to ToT Created 5 years, 7 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/GrTargetCommands.cpp ('k') | src/gpu/GrTest.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 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 "GrTessellatingPathRenderer.h" 8 #include "GrTessellatingPathRenderer.h"
9 9
10 #include "GrBatch.h" 10 #include "GrBatch.h"
(...skipping 1421 matching lines...) Expand 10 before | Expand all | Expand 10 after
1432 count += (poly->fCount - 2) * (WIREFRAME ? 6 : 3); 1432 count += (poly->fCount - 2) * (WIREFRAME ? 6 : 3);
1433 } 1433 }
1434 } 1434 }
1435 if (0 == count) { 1435 if (0 == count) {
1436 return; 1436 return;
1437 } 1437 }
1438 1438
1439 size_t stride = gp->getVertexStride(); 1439 size_t stride = gp->getVertexStride();
1440 const GrVertexBuffer* vertexBuffer; 1440 const GrVertexBuffer* vertexBuffer;
1441 int firstVertex; 1441 int firstVertex;
1442 void* verts = batchTarget->vertexPool()->makeSpace(stride, 1442 void* verts = batchTarget->makeVertSpace(stride, count, &vertexBuffer, & firstVertex);
1443 count,
1444 &vertexBuffer,
1445 &firstVertex);
1446
1447 if (!verts) { 1443 if (!verts) {
1448 SkDebugf("Could not allocate vertices\n"); 1444 SkDebugf("Could not allocate vertices\n");
1449 return; 1445 return;
1450 } 1446 }
1451 1447
1452 LOG("emitting %d verts\n", count); 1448 LOG("emitting %d verts\n", count);
1453 void* end = polys_to_triangles(polys, fillType, verts); 1449 void* end = polys_to_triangles(polys, fillType, verts);
1454 int actualCount = static_cast<int>( 1450 int actualCount = static_cast<int>(
1455 (static_cast<char*>(end) - static_cast<char*>(verts)) / stride); 1451 (static_cast<char*>(end) - static_cast<char*>(verts)) / stride);
1456 LOG("actual count: %d\n", actualCount); 1452 LOG("actual count: %d\n", actualCount);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
1511 SkMatrix vmi; 1507 SkMatrix vmi;
1512 if (!viewM.invert(&vmi)) { 1508 if (!viewM.invert(&vmi)) {
1513 return false; 1509 return false;
1514 } 1510 }
1515 vmi.mapRect(&clipBounds); 1511 vmi.mapRect(&clipBounds);
1516 SkAutoTUnref<GrBatch> batch(TessellatingPathBatch::Create(color, path, viewM , clipBounds)); 1512 SkAutoTUnref<GrBatch> batch(TessellatingPathBatch::Create(color, path, viewM , clipBounds));
1517 target->drawBatch(pipelineBuilder, batch); 1513 target->drawBatch(pipelineBuilder, batch);
1518 1514
1519 return true; 1515 return true;
1520 } 1516 }
OLDNEW
« no previous file with comments | « src/gpu/GrTargetCommands.cpp ('k') | src/gpu/GrTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698