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

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

Issue 2104383003: Hide GrDrawVerticesBatch::Geometry and rename to Mesh (Closed) Base URL: https://chromium.googlesource.com/skia.git@moremore
Patch Set: Created 4 years, 6 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/GrDrawContext.cpp ('k') | 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 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;
};
« no previous file with comments | « src/gpu/GrDrawContext.cpp ('k') | src/gpu/batches/GrDrawVerticesBatch.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698