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

Unified Diff: src/gpu/batches/GrDrawAtlasBatch.cpp

Issue 1286043004: Make GrVertexBatch objects hold their own draws during GrDrawTarget flush (Closed) Base URL: https://skia.googlesource.com/skia.git@m
Patch Set: forward decl Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/batches/GrDrawAtlasBatch.h ('k') | src/gpu/batches/GrDrawBatch.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrDrawAtlasBatch.cpp
diff --git a/src/gpu/batches/GrDrawAtlasBatch.cpp b/src/gpu/batches/GrDrawAtlasBatch.cpp
index 487580c39da73bc837e454eb960c08d2cba423d5..3596e16861fa6a51b4b73a9b759a8a5ecf8fa57c 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,
« no previous file with comments | « src/gpu/batches/GrDrawAtlasBatch.h ('k') | src/gpu/batches/GrDrawBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698