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

Unified Diff: src/gpu/GrAALinearizingConvexPathRenderer.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/GrAAHairLinePathRenderer.cpp ('k') | src/gpu/GrAtlasTextContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAALinearizingConvexPathRenderer.cpp
diff --git a/src/gpu/GrAALinearizingConvexPathRenderer.cpp b/src/gpu/GrAALinearizingConvexPathRenderer.cpp
index d1dc00dbed1d0382753e36138f46a58f2b03a1a2..c7b1da062703a876fb634b462759789a7c1e137d 100644
--- a/src/gpu/GrAALinearizingConvexPathRenderer.cpp
+++ b/src/gpu/GrAALinearizingConvexPathRenderer.cpp
@@ -9,7 +9,7 @@
#include "GrAALinearizingConvexPathRenderer.h"
#include "GrAAConvexTessellator.h"
-#include "GrBatchTarget.h"
+#include "GrBatchFlushState.h"
#include "GrBatchTest.h"
#include "GrContext.h"
#include "GrDefaultGeoProcFactory.h"
@@ -155,7 +155,7 @@ public:
fBatch.fCanTweakAlphaForCoverage = opt.canTweakAlphaForCoverage();
}
- void draw(GrBatchTarget* batchTarget, const GrPipeline* pipeline, int vertexCount,
+ void draw(GrVertexBatch::Target* target, const GrPipeline* pipeline, int vertexCount,
size_t vertexStride, void* vertices, int indexCount, uint16_t* indices) {
if (vertexCount == 0 || indexCount == 0) {
return;
@@ -163,8 +163,8 @@ public:
const GrVertexBuffer* vertexBuffer;
GrVertices info;
int firstVertex;
- void* verts = batchTarget->makeVertSpace(vertexStride, vertexCount, &vertexBuffer,
- &firstVertex);
+ void* verts = target->makeVertexSpace(vertexStride, vertexCount, &vertexBuffer,
+ &firstVertex);
if (!verts) {
SkDebugf("Could not allocate vertices\n");
return;
@@ -173,7 +173,7 @@ public:
const GrIndexBuffer* indexBuffer;
int firstIndex;
- uint16_t* idxs = batchTarget->makeIndexSpace(indexCount, &indexBuffer, &firstIndex);
+ uint16_t* idxs = target->makeIndexSpace(indexCount, &indexBuffer, &firstIndex);
if (!idxs) {
SkDebugf("Could not allocate indices\n");
return;
@@ -181,10 +181,10 @@ public:
memcpy(idxs, indices, indexCount * sizeof(uint16_t));
info.initIndexed(kTriangles_GrPrimitiveType, vertexBuffer, indexBuffer, firstVertex,
firstIndex, vertexCount, indexCount);
- batchTarget->draw(info);
+ target->draw(info);
}
- void generateGeometry(GrBatchTarget* batchTarget) override {
+ void onPrepareDraws(Target* target) override {
bool canTweakAlphaForCoverage = this->canTweakAlphaForCoverage();
// Setup GrGeometryProcessor
@@ -197,7 +197,7 @@ public:
return;
}
- batchTarget->initDraw(gp, this->pipeline());
+ target->initDraw(gp, this->pipeline());
size_t vertexStride = gp->getVertexStride();
@@ -226,8 +226,8 @@ public:
if (indexCount + currentIndices > UINT16_MAX) {
// if we added the current instance, we would overflow the indices we can store in a
// uint16_t. Draw what we've got so far and reset.
- draw(batchTarget, this->pipeline(), vertexCount, vertexStride, vertices, indexCount,
- indices);
+ draw(target, this->pipeline(), vertexCount, vertexStride, vertices, indexCount,
+ indices);
vertexCount = 0;
indexCount = 0;
}
@@ -246,7 +246,7 @@ public:
vertexCount += currentVertices;
indexCount += currentIndices;
}
- draw(batchTarget, this->pipeline(), vertexCount, vertexStride, vertices, indexCount,
+ draw(target, this->pipeline(), vertexCount, vertexStride, vertices, indexCount,
indices);
free(vertices);
free(indices);
« no previous file with comments | « src/gpu/GrAAHairLinePathRenderer.cpp ('k') | src/gpu/GrAtlasTextContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698