blob: 936b53d006d1d68d9be98892c39365259f0fbe75 [file] [log] [blame]
/*
* Copyright 2021 Google LLC.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef GrStrokeFixedCountTessellator_DEFINED
#define GrStrokeFixedCountTessellator_DEFINED
#include "src/gpu/GrVertexChunkArray.h"
#include "src/gpu/tessellate/GrStrokeTessellator.h"
// Renders strokes as fixed-count triangle strip instances. Any extra triangles not needed by the
// instance are emitted as degenerate triangles.
class GrStrokeFixedCountTessellator : public GrStrokeTessellator {
public:
GrStrokeFixedCountTessellator(ShaderFlags shaderFlags, const SkMatrix& viewMatrix,
PathStrokeList* pathStrokeList)
: GrStrokeTessellator(GrStrokeTessellateShader::Mode::kFixedCount, shaderFlags,
viewMatrix, pathStrokeList) {
}
void prepare(GrMeshDrawOp::Target*, int totalCombinedVerbCnt) override;
void draw(GrOpFlushState*) const override;
private:
GrVertexChunkArray fInstanceChunks;
int fFixedVertexCount = 0;
};
#endif