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

Unified Diff: src/gpu/batches/GrDrawVerticesBatch.h

Issue 1365673003: Fix GrDrawVerticesBatch to work with override colors and eliminate local coords when posssible. (Closed) Base URL: https://skia.googlesource.com/skia.git@mangle
Patch Set: more Created 5 years, 3 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 | « no previous file | src/gpu/batches/GrDrawVerticesBatch.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrDrawVerticesBatch.h
diff --git a/src/gpu/batches/GrDrawVerticesBatch.h b/src/gpu/batches/GrDrawVerticesBatch.h
index 49e93c8370e15543dd0e7093a57282d1ed841483..8503b0121e28bf991c9822bf73972c3177fd5fdf 100644
--- a/src/gpu/batches/GrDrawVerticesBatch.h
+++ b/src/gpu/batches/GrDrawVerticesBatch.h
@@ -23,7 +23,7 @@ public:
DEFINE_BATCH_CLASS_ID
struct Geometry {
- GrColor fColor;
+ GrColor fColor; // Only used if there are no per-vertex colors
SkTDArray<SkPoint> fPositions;
SkTDArray<uint16_t> fIndices;
SkTDArray<GrColor> fColors;
@@ -58,40 +58,22 @@ private:
const uint16_t* indices, int indexCount,
const GrColor* colors, const SkPoint* localCoords, const SkRect& bounds);
- GrPrimitiveType primitiveType() const { return fBatch.fPrimitiveType; }
+ GrPrimitiveType primitiveType() const { return fPrimitiveType; }
bool batchablePrimitiveType() const {
- return kTriangles_GrPrimitiveType == fBatch.fPrimitiveType ||
- kLines_GrPrimitiveType == fBatch.fPrimitiveType ||
- kPoints_GrPrimitiveType == fBatch.fPrimitiveType;
+ return kTriangles_GrPrimitiveType == fPrimitiveType ||
+ kLines_GrPrimitiveType == fPrimitiveType ||
+ kPoints_GrPrimitiveType == fPrimitiveType;
}
- GrColor color() const { return fBatch.fColor; }
- bool usesLocalCoords() const { return fBatch.fUsesLocalCoords; }
- bool colorIgnored() const { return fBatch.fColorIgnored; }
- const SkMatrix& viewMatrix() const { return fBatch.fViewMatrix; }
- bool hasColors() const { return fBatch.fHasColors; }
- bool hasIndices() const { return fBatch.fHasIndices; }
- bool hasLocalCoords() const { return fBatch.fHasLocalCoords; }
- int vertexCount() const { return fBatch.fVertexCount; }
- int indexCount() const { return fBatch.fIndexCount; }
- bool coverageIgnored() const { return fBatch.fCoverageIgnored; }
bool onCombineIfPossible(GrBatch* t, const GrCaps&) override;
- struct BatchTracker {
- GrPrimitiveType fPrimitiveType;
- SkMatrix fViewMatrix;
- GrColor fColor;
- bool fUsesLocalCoords;
- bool fColorIgnored;
- bool fCoverageIgnored;
- bool fHasColors;
- bool fHasIndices;
- bool fHasLocalCoords;
- int fVertexCount;
- int fIndexCount;
- };
+ GrPrimitiveType fPrimitiveType;
+ SkMatrix fViewMatrix;
+ bool fVariableColor;
+ int fVertexCount;
+ int fIndexCount;
+ bool fCoverageIgnored; // comes from initBatchTracker.
- BatchTracker fBatch;
SkSTArray<1, Geometry, true> fGeoData;
typedef GrVertexBatch INHERITED;
« no previous file with comments | « no previous file | src/gpu/batches/GrDrawVerticesBatch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698