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

Unified Diff: src/gpu/GrImmediateDrawTarget.cpp

Issue 1293583002: Introduce GrBatch subclasses GrDrawBatch and GrVertexBatch to prepare for non-drawing batches (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove duplicated fields in GrVertexBatch 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/GrImmediateDrawTarget.h ('k') | src/gpu/GrInOrderCommandBuilder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrImmediateDrawTarget.cpp
diff --git a/src/gpu/GrImmediateDrawTarget.cpp b/src/gpu/GrImmediateDrawTarget.cpp
index 999446f0a46c244790c2121612bf864c3d260f3f..3bff379cad4226c8ba994ecb4c9027dd451aef3d 100644
--- a/src/gpu/GrImmediateDrawTarget.cpp
+++ b/src/gpu/GrImmediateDrawTarget.cpp
@@ -25,14 +25,17 @@ GrImmediateDrawTarget::~GrImmediateDrawTarget() {
this->reset();
}
-void GrImmediateDrawTarget::onDrawBatch(GrBatch* batch) {
+void GrImmediateDrawTarget::onDrawBatch(GrDrawBatch* batch) {
fBatchTarget.resetNumberOfDraws();
- batch->generateGeometry(&fBatchTarget);
- batch->setNumberOfDraws(fBatchTarget.numberOfDraws());
+ // TODO: encapsulate the specialization of GrVertexBatch in GrVertexBatch so that we can
+ // remove this cast. Currently all GrDrawBatches are in fact GrVertexBatch.
+ GrVertexBatch* vertexBatch = static_cast<GrVertexBatch*>(batch);
+ vertexBatch->generateGeometry(&fBatchTarget);
+ vertexBatch->setNumberOfDraws(fBatchTarget.numberOfDraws());
fBatchTarget.preFlush();
- fBatchTarget.flushNext(batch->numberOfDraws());
+ fBatchTarget.flushNext(vertexBatch->numberOfDraws());
fBatchTarget.postFlush();
}
« no previous file with comments | « src/gpu/GrImmediateDrawTarget.h ('k') | src/gpu/GrInOrderCommandBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698