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

Unified Diff: src/gpu/GrDefaultPathRenderer.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/GrContext.cpp ('k') | src/gpu/GrImmediateDrawTarget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDefaultPathRenderer.cpp
diff --git a/src/gpu/GrDefaultPathRenderer.cpp b/src/gpu/GrDefaultPathRenderer.cpp
index 9ab020495e3134e43cc635fdf462b692d553ad32..8c663390cc98acc36a0301cab060bd95ff9efd49 100644
--- a/src/gpu/GrDefaultPathRenderer.cpp
+++ b/src/gpu/GrDefaultPathRenderer.cpp
@@ -7,7 +7,7 @@
#include "GrDefaultPathRenderer.h"
-#include "GrBatchTarget.h"
+#include "GrBatchFlushState.h"
#include "GrBatchTest.h"
#include "GrContext.h"
#include "GrDefaultGeoProcFactory.h"
@@ -248,7 +248,7 @@ public:
fBatch.fCoverageIgnored = !opt.readsCoverage();
}
- void generateGeometry(GrBatchTarget* batchTarget) override {
+ void onPrepareDraws(Target* target) override {
SkAutoTUnref<const GrGeometryProcessor> gp;
{
using namespace GrDefaultGeoProcFactory;
@@ -266,7 +266,7 @@ public:
size_t vertexStride = gp->getVertexStride();
SkASSERT(vertexStride == sizeof(SkPoint));
- batchTarget->initDraw(gp, this->pipeline());
+ target->initDraw(gp, this->pipeline());
int instanceCount = fGeoData.count();
@@ -313,8 +313,8 @@ public:
const GrVertexBuffer* vertexBuffer;
int firstVertex;
- void* verts = batchTarget->makeVertSpace(vertexStride, maxVertices,
- &vertexBuffer, &firstVertex);
+ void* verts = target->makeVertexSpace(vertexStride, maxVertices,
+ &vertexBuffer, &firstVertex);
if (!verts) {
SkDebugf("Could not allocate vertices\n");
@@ -326,7 +326,7 @@ public:
void* indices = NULL;
if (isIndexed) {
- indices = batchTarget->makeIndexSpace(maxIndices, &indexBuffer, &firstIndex);
+ indices = target->makeIndexSpace(maxIndices, &indexBuffer, &firstIndex);
if (!indices) {
SkDebugf("Could not allocate indices\n");
@@ -366,11 +366,11 @@ public:
} else {
vertices.init(primitiveType, vertexBuffer, firstVertex, vertexOffset);
}
- batchTarget->draw(vertices);
+ target->draw(vertices);
// put back reserves
- batchTarget->putBackIndices((size_t)(maxIndices - indexOffset));
- batchTarget->putBackVertices((size_t)(maxVertices - vertexOffset), (size_t)vertexStride);
+ target->putBackIndices((size_t)(maxIndices - indexOffset));
+ target->putBackVertices((size_t)(maxVertices - vertexOffset), (size_t)vertexStride);
}
SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; }
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrImmediateDrawTarget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698