GrQuadPerEdgeAA::Tessellator owns GrVertexWriter
Change-Id: I3c8bf48dda061aa9d318b9f81f22608fdd68fcbd
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/255786
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/ops/GrQuadPerEdgeAA.h b/src/gpu/ops/GrQuadPerEdgeAA.h
index 1ba92ca..2b99c68 100644
--- a/src/gpu/ops/GrQuadPerEdgeAA.h
+++ b/src/gpu/ops/GrQuadPerEdgeAA.h
@@ -14,6 +14,7 @@
#include "src/gpu/GrColor.h"
#include "src/gpu/GrGeometryProcessor.h"
#include "src/gpu/GrSamplerState.h"
+#include "src/gpu/GrVertexWriter.h"
#include "src/gpu/geometry/GrQuad.h"
#include "src/gpu/geometry/GrQuadUtils.h"
#include "src/gpu/ops/GrMeshDrawOp.h"
@@ -134,14 +135,16 @@
// MakeProcessor and/or MakeTexturedProcessor.
class Tessellator {
public:
- explicit Tessellator(const VertexSpec& spec);
+ explicit Tessellator(const VertexSpec& spec, char* vertices);
- // Calculates (as needed) inset and outset geometry for anti-aliasing, and writes all
- // necessary position and vertex attributes required by this Tessellator's VertexSpec.
- // After appending, this will return the pointer to the next vertex in the VBO.
- void* append(void* vertices, const GrQuad& deviceQuad, const GrQuad& localQuad,
+ // Calculates (as needed) inset and outset geometry for anti-aliasing, and appends all
+ // necessary position and vertex attributes required by this Tessellator's VertexSpec into
+ // the 'vertices' the Tessellator was called with.
+ void append(const GrQuad& deviceQuad, const GrQuad& localQuad,
const SkPMColor4f& color, const SkRect& uvDomain, GrQuadAAFlags aaFlags);
+ SkDEBUGCODE(char* vertices() const { return (char*) fVertexWriter.fPtr; })
+
private:
// VertexSpec defines many unique ways to write vertex attributes, which can be handled
// generically by branching per-quad based on the VertexSpec. However, there are several
@@ -155,6 +158,7 @@
GrQuadUtils::TessellationHelper fAAHelper;
VertexSpec fVertexSpec;
+ GrVertexWriter fVertexWriter;
WriteQuadProc fWriteProc;
};