diff options
author | bsalomon <bsalomon@google.com> | 2015-08-17 12:55:38 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-17 12:55:38 -0700 |
commit | 7539856c1b9cbb1886a6a498cc534b77fc83ddb2 (patch) | |
tree | d56158986f7db1a81d2a7b9a791332665094befc /src/gpu/batches/GrDrawAtlasBatch.cpp | |
parent | 1a899c9d547e5f12505e5bf654e4fb8b7dda0669 (diff) |
Make GrVertexBatch objects hold their own draws during GrDrawTarget flush
NO_MERGE_BUILDS
Review URL: https://codereview.chromium.org/1286043004
Diffstat (limited to 'src/gpu/batches/GrDrawAtlasBatch.cpp')
-rw-r--r-- | src/gpu/batches/GrDrawAtlasBatch.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gpu/batches/GrDrawAtlasBatch.cpp b/src/gpu/batches/GrDrawAtlasBatch.cpp index 487580c39d..3596e16861 100644 --- a/src/gpu/batches/GrDrawAtlasBatch.cpp +++ b/src/gpu/batches/GrDrawAtlasBatch.cpp @@ -6,6 +6,7 @@ */ #include "GrDrawAtlasBatch.h" +#include "GrBatchFlushState.h" #include "GrBatchTest.h" #include "SkGr.h" #include "SkRandom.h" @@ -41,14 +42,14 @@ static const GrGeometryProcessor* set_vertex_attributes(bool hasColors, return GrDefaultGeoProcFactory::Create(gpColor, coverage, localCoords, viewMatrix); } -void GrDrawAtlasBatch::generateGeometry(GrBatchTarget* batchTarget) { +void GrDrawAtlasBatch::onPrepareDraws(Target* target) { // Setup geometry processor SkAutoTUnref<const GrGeometryProcessor> gp(set_vertex_attributes(this->hasColors(), this->color(), this->viewMatrix(), this->coverageIgnored())); - batchTarget->initDraw(gp, this->pipeline()); + target->initDraw(gp, this->pipeline()); int instanceCount = fGeoData.count(); size_t vertexStride = gp->getVertexStride(); @@ -57,7 +58,7 @@ void GrDrawAtlasBatch::generateGeometry(GrBatchTarget* batchTarget) { QuadHelper helper; int numQuads = this->quadCount(); - void* verts = helper.init(batchTarget, vertexStride, numQuads); + void* verts = helper.init(target, vertexStride, numQuads); if (!verts) { SkDebugf("Could not allocate vertices\n"); return; @@ -71,7 +72,7 @@ void GrDrawAtlasBatch::generateGeometry(GrBatchTarget* batchTarget) { memcpy(vertPtr, args.fVerts.begin(), allocSize); vertPtr += allocSize; } - helper.issueDraw(batchTarget); + helper.recordDraw(target); } GrDrawAtlasBatch::GrDrawAtlasBatch(const Geometry& geometry, const SkMatrix& viewMatrix, |