| Index: src/gpu/batches/GrDrawVerticesBatch.h
|
| diff --git a/src/gpu/batches/GrDrawVerticesBatch.h b/src/gpu/batches/GrDrawVerticesBatch.h
|
| index f2b1ea9f8afc62e09af86b143301f4b4ec83862e..9665c1a905a84005277dbcbb925190ea1c6d456a 100644
|
| --- a/src/gpu/batches/GrDrawVerticesBatch.h
|
| +++ b/src/gpu/batches/GrDrawVerticesBatch.h
|
| @@ -22,23 +22,12 @@ class GrDrawVerticesBatch : public GrVertexBatch {
|
| public:
|
| DEFINE_BATCH_CLASS_ID
|
|
|
| - struct Geometry {
|
| - GrColor fColor; // Only used if there are no per-vertex colors
|
| - SkTDArray<SkPoint> fPositions;
|
| - SkTDArray<uint16_t> fIndices;
|
| - SkTDArray<GrColor> fColors;
|
| - SkTDArray<SkPoint> fLocalCoords;
|
| - };
|
|
|
| - static GrDrawBatch* Create(const Geometry& geometry, GrPrimitiveType primitiveType,
|
| - const SkMatrix& viewMatrix,
|
| - const SkPoint* positions, int vertexCount,
|
| - const uint16_t* indices, int indexCount,
|
| - const GrColor* colors, const SkPoint* localCoords,
|
| - const SkRect& bounds) {
|
| - return new GrDrawVerticesBatch(geometry, primitiveType, viewMatrix, positions, vertexCount,
|
| - indices, indexCount, colors, localCoords, bounds);
|
| - }
|
| + GrDrawVerticesBatch(GrColor color, GrPrimitiveType primitiveType,
|
| + const SkMatrix& viewMatrix,
|
| + const SkPoint* positions, int vertexCount,
|
| + const uint16_t* indices, int indexCount,
|
| + const GrColor* colors, const SkPoint* localCoords, const SkRect& bounds);
|
|
|
| const char* name() const override { return "DrawVerticesBatch"; }
|
|
|
| @@ -46,18 +35,10 @@ public:
|
| GrInitInvariantOutput* coverage,
|
| GrBatchToXPOverrides* overrides) const override;
|
|
|
| - SkSTArray<1, Geometry, true>* geoData() { return &fGeoData; }
|
| -
|
| private:
|
| void onPrepareDraws(Target*) const override;
|
| void initBatchTracker(const GrXPOverridesForBatch&) override;
|
|
|
| - GrDrawVerticesBatch(const Geometry& geometry, GrPrimitiveType primitiveType,
|
| - const SkMatrix& viewMatrix,
|
| - const SkPoint* positions, int vertexCount,
|
| - const uint16_t* indices, int indexCount,
|
| - const GrColor* colors, const SkPoint* localCoords, const SkRect& bounds);
|
| -
|
| GrPrimitiveType primitiveType() const { return fPrimitiveType; }
|
| bool batchablePrimitiveType() const {
|
| return kTriangles_GrPrimitiveType == fPrimitiveType ||
|
| @@ -67,6 +48,14 @@ private:
|
|
|
| bool onCombineIfPossible(GrBatch* t, const GrCaps&) override;
|
|
|
| + struct Mesh {
|
| + GrColor fColor; // Only used if there are no per-vertex colors
|
| + SkTDArray<SkPoint> fPositions;
|
| + SkTDArray<uint16_t> fIndices;
|
| + SkTDArray<GrColor> fColors;
|
| + SkTDArray<SkPoint> fLocalCoords;
|
| + };
|
| +
|
| GrPrimitiveType fPrimitiveType;
|
| SkMatrix fViewMatrix;
|
| bool fVariableColor;
|
| @@ -74,7 +63,7 @@ private:
|
| int fIndexCount;
|
| bool fCoverageIgnored; // comes from initBatchTracker.
|
|
|
| - SkSTArray<1, Geometry, true> fGeoData;
|
| + SkSTArray<1, Mesh, true> fMeshes;
|
|
|
| typedef GrVertexBatch INHERITED;
|
| };
|
|
|