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

Unified Diff: src/gpu/GrVertices.h

Issue 1806983002: Update how we send draws to gpu backend to reduce state setting. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 4 years, 9 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/GrVertices.h
diff --git a/src/gpu/GrVertices.h b/src/gpu/GrVertices.h
index 03ede07d154cc2d9ddefad0eef620d9eaa2036c2..c2ba1e7d59c8fd31d8489301d1580e56e7d98b45 100644
--- a/src/gpu/GrVertices.h
+++ b/src/gpu/GrVertices.h
@@ -13,7 +13,6 @@
class GrNonInstancedVertices {
public:
- GrPrimitiveType primitiveType() const { return fPrimitiveType; }
int startVertex() const { return fStartVertex; }
int startIndex() const { return fStartIndex; }
int vertexCount() const { return fVertexCount; }
@@ -24,7 +23,6 @@ public:
const GrIndexBuffer* indexBuffer() const { return fIndexBuffer.get(); }
protected:
- GrPrimitiveType fPrimitiveType;
int fStartVertex;
int fStartIndex;
int fVertexCount;
@@ -46,12 +44,10 @@ public:
GrVertices(const GrVertices& di) { (*this) = di; }
GrVertices& operator =(const GrVertices& di);
- void init(GrPrimitiveType primType, const GrVertexBuffer* vertexBuffer, int startVertex,
- int vertexCount) {
+ void init(const GrVertexBuffer* vertexBuffer, int startVertex, int vertexCount) {
SkASSERT(vertexBuffer);
SkASSERT(vertexCount);
SkASSERT(startVertex >= 0);
- fPrimitiveType = primType;
fVertexBuffer.reset(vertexBuffer);
fIndexBuffer.reset(nullptr);
fStartVertex = startVertex;
@@ -64,20 +60,18 @@ public:
fMaxInstancesPerDraw = 0;
}
- void initIndexed(GrPrimitiveType primType,
- const GrVertexBuffer* vertexBuffer,
- const GrIndexBuffer* indexBuffer,
- int startVertex,
- int startIndex,
- int vertexCount,
- int indexCount) {
+ void initIndexed(const GrVertexBuffer* vertexBuffer,
+ const GrIndexBuffer* indexBuffer,
+ int startVertex,
+ int startIndex,
+ int vertexCount,
+ int indexCount) {
SkASSERT(indexBuffer);
SkASSERT(vertexBuffer);
SkASSERT(indexCount);
SkASSERT(vertexCount);
SkASSERT(startIndex >= 0);
SkASSERT(startVertex >= 0);
- fPrimitiveType = primType;
fVertexBuffer.reset(vertexBuffer);
fIndexBuffer.reset(indexBuffer);
fStartVertex = startVertex;
@@ -94,21 +88,19 @@ public:
/** Variation of the above that may be used when the total number of instances may exceed
the number of instances supported by the index buffer. To be used with
nextInstances() to draw in max-sized batches.*/
- void initInstanced(GrPrimitiveType primType,
- const GrVertexBuffer* vertexBuffer,
- const GrIndexBuffer* indexBuffer,
- int startVertex,
- int verticesPerInstance,
- int indicesPerInstance,
- int instanceCount,
- int maxInstancesPerDraw) {
+ void initInstanced(const GrVertexBuffer* vertexBuffer,
+ const GrIndexBuffer* indexBuffer,
+ int startVertex,
+ int verticesPerInstance,
+ int indicesPerInstance,
+ int instanceCount,
+ int maxInstancesPerDraw) {
SkASSERT(vertexBuffer);
SkASSERT(indexBuffer);
SkASSERT(instanceCount);
SkASSERT(verticesPerInstance);
SkASSERT(indicesPerInstance);
SkASSERT(startVertex >= 0);
- fPrimitiveType = primType;
fVertexBuffer.reset(vertexBuffer);
fIndexBuffer.reset(indexBuffer);
fStartVertex = startVertex;
@@ -145,7 +137,6 @@ public:
vertices.fIndicesPerInstance;
fInstanceBatch.fVertexCount = vertices.fMaxInstancesPerDraw *
vertices.fVerticesPerInstance;
- fInstanceBatch.fPrimitiveType = vertices.fPrimitiveType;
fInstanceBatch.fStartIndex = vertices.fStartIndex;
fInstanceBatch.fStartVertex = vertices.fStartVertex;
fInstancesRemaining = vertices.fInstanceCount - vertices.fMaxInstancesPerDraw;

Powered by Google App Engine
This is Rietveld 408576698