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

Unified Diff: src/gpu/GrContext.cpp

Issue 1122673002: Start on simplifying generateGeometry() overrides (Closed) Base URL: https://skia.googlesource.com/skia.git@ibcache
Patch Set: drawinfo changes Created 5 years, 8 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
Index: src/gpu/GrContext.cpp
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 819774a076a88b657f270dd7bc171a4a4908aaa6..a9c6ce0b5a2c1223b30deb5387c36e3a19389db8 100755
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -502,15 +502,7 @@ public:
}
GrDrawTarget::DrawInfo drawInfo;
- drawInfo.setPrimitiveType(primType);
- drawInfo.setVertexBuffer(vertexBuffer);
- drawInfo.setStartVertex(firstVertex);
- drawInfo.setVertexCount(vertexCount);
- drawInfo.setStartIndex(0);
- drawInfo.setIndexCount(0);
- drawInfo.setInstanceCount(0);
- drawInfo.setVerticesPerInstance(0);
- drawInfo.setIndicesPerInstance(0);
+ drawInfo.init(primType, vertexBuffer, firstVertex, vertexCount);
batchTarget->draw(drawInfo);
}
@@ -829,8 +821,8 @@ public:
return;
}
- const GrIndexBuffer* indexBuffer;
- int firstIndex;
+ const GrIndexBuffer* indexBuffer = NULL;
+ int firstIndex = 0;
void* indices = NULL;
if (this->hasIndices()) {
@@ -870,17 +862,12 @@ public:
}
GrDrawTarget::DrawInfo drawInfo;
- drawInfo.setPrimitiveType(this->primitiveType());
- drawInfo.setVertexBuffer(vertexBuffer);
- drawInfo.setStartVertex(firstVertex);
- drawInfo.setVertexCount(this->vertexCount());
if (this->hasIndices()) {
- drawInfo.setIndexBuffer(indexBuffer);
- drawInfo.setStartIndex(firstIndex);
- drawInfo.setIndexCount(this->indexCount());
+ drawInfo.initIndexed(this->primitiveType(), vertexBuffer, indexBuffer, firstVertex,
+ firstIndex, this->vertexCount(), this->indexCount());
+
} else {
- drawInfo.setStartIndex(0);
- drawInfo.setIndexCount(0);
+ drawInfo.init(this->primitiveType(), vertexBuffer, firstVertex, this->vertexCount());
}
batchTarget->draw(drawInfo);
}
« no previous file with comments | « src/gpu/GrBatch.cpp ('k') | src/gpu/GrDefaultPathRenderer.cpp » ('j') | src/gpu/GrDrawTarget.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698