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

Unified Diff: src/gpu/batches/GrDrawVerticesBatch.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/GrDrawVerticesBatch.h ('k') | src/gpu/batches/GrStrokeRectBatch.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrDrawVerticesBatch.cpp
diff --git a/src/gpu/batches/GrDrawVerticesBatch.cpp b/src/gpu/batches/GrDrawVerticesBatch.cpp
index ebfda362960433288fd7ff8e67d0b7ad64899175..bca7d230bcda7e5f2ed14a9a2f802f54a11ab5ee 100644
--- a/src/gpu/batches/GrDrawVerticesBatch.cpp
+++ b/src/gpu/batches/GrDrawVerticesBatch.cpp
@@ -7,7 +7,7 @@
#include "GrDrawVerticesBatch.h"
-#include "GrBatchTarget.h"
+#include "GrBatchFlushState.h"
#include "GrInvariantOutput.h"
#include "GrDefaultGeoProcFactory.h"
@@ -107,14 +107,14 @@ void GrDrawVerticesBatch::initBatchTracker(const GrPipelineOptimizations& opt) {
fBatch.fCoverageIgnored = !opt.readsCoverage();
}
-void GrDrawVerticesBatch::generateGeometry(GrBatchTarget* batchTarget) {
+void GrDrawVerticesBatch::onPrepareDraws(Target* target) {
int colorOffset = -1, texOffset = -1;
SkAutoTUnref<const GrGeometryProcessor> gp(
set_vertex_attributes(this->hasLocalCoords(), this->hasColors(), &colorOffset,
&texOffset, this->color(), this->viewMatrix(),
this->coverageIgnored()));
- batchTarget->initDraw(gp, this->pipeline());
+ target->initDraw(gp, this->pipeline());
size_t vertexStride = gp->getVertexStride();
@@ -126,8 +126,8 @@ void GrDrawVerticesBatch::generateGeometry(GrBatchTarget* batchTarget) {
const GrVertexBuffer* vertexBuffer;
int firstVertex;
- void* verts = batchTarget->makeVertSpace(vertexStride, this->vertexCount(),
- &vertexBuffer, &firstVertex);
+ void* verts = target->makeVertexSpace(vertexStride, this->vertexCount(),
+ &vertexBuffer, &firstVertex);
if (!verts) {
SkDebugf("Could not allocate vertices\n");
@@ -139,7 +139,7 @@ void GrDrawVerticesBatch::generateGeometry(GrBatchTarget* batchTarget) {
uint16_t* indices = NULL;
if (this->hasIndices()) {
- indices = batchTarget->makeIndexSpace(this->indexCount(), &indexBuffer, &firstIndex);
+ indices = target->makeIndexSpace(this->indexCount(), &indexBuffer, &firstIndex);
if (!indices) {
SkDebugf("Could not allocate indices\n");
@@ -180,7 +180,7 @@ void GrDrawVerticesBatch::generateGeometry(GrBatchTarget* batchTarget) {
} else {
vertices.init(this->primitiveType(), vertexBuffer, firstVertex, this->vertexCount());
}
- batchTarget->draw(vertices);
+ target->draw(vertices);
}
bool GrDrawVerticesBatch::onCombineIfPossible(GrBatch* t, const GrCaps& caps) {
« no previous file with comments | « src/gpu/batches/GrDrawVerticesBatch.h ('k') | src/gpu/batches/GrStrokeRectBatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698