Move GrStrokeTessellator into its own header file
Simple refactor to make things reusable for the next non-hardware stroke
tessellator.
Change-Id: I0898b54a616e60f0475ac74cbd6f518e8696e0e5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/390078
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/tessellate/GrStrokeTessellateOp.h b/src/gpu/tessellate/GrStrokeTessellateOp.h
index feb2f78..33f521b 100644
--- a/src/gpu/tessellate/GrStrokeTessellateOp.h
+++ b/src/gpu/tessellate/GrStrokeTessellateOp.h
@@ -11,41 +11,10 @@
#include "include/core/SkStrokeRec.h"
#include "src/gpu/ops/GrMeshDrawOp.h"
#include "src/gpu/tessellate/GrPathShader.h"
-#include "src/gpu/tessellate/GrStrokeTessellateShader.h"
+#include "src/gpu/tessellate/GrStrokeTessellator.h"
class GrRecordingContext;
-// Prepares GPU data for, and then draws a stroke's tessellated geometry.
-class GrStrokeTessellator {
-public:
- using ShaderFlags = GrStrokeTessellateShader::ShaderFlags;
-
- struct PathStrokeList {
- PathStrokeList(const SkPath& path, const SkStrokeRec& stroke, const SkPMColor4f& color)
- : fPath(path), fStroke(stroke), fColor(color) {}
- SkPath fPath;
- SkStrokeRec fStroke;
- SkPMColor4f fColor;
- PathStrokeList* fNext = nullptr;
- };
-
- GrStrokeTessellator(ShaderFlags shaderFlags, PathStrokeList* pathStrokeList)
- : fShaderFlags(shaderFlags), fPathStrokeList(pathStrokeList) {}
-
- // Called before draw(). Prepares GPU buffers containing the geometry to tessellate.
- virtual void prepare(GrMeshDrawOp::Target*, const SkMatrix&) = 0;
-
- // Issues draw calls for the tessellated stroke. The caller is responsible for binding its
- // desired pipeline ahead of time.
- virtual void draw(GrOpFlushState*) const = 0;
-
- virtual ~GrStrokeTessellator() {}
-
-protected:
- const ShaderFlags fShaderFlags;
- PathStrokeList* fPathStrokeList;
-};
-
// Renders strokes by linearizing them into sorted "parametric" and "radial" edges. See
// GrStrokeTessellateShader.
class GrStrokeTessellateOp : public GrDrawOp {