Flutter Engine
The Flutter Engine
StrokeTessellator.h
Go to the documentation of this file.
1/*
2 * Copyright 2022 Google LLC
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#ifndef StrokeTessellator_DEFINED
9#define StrokeTessellator_DEFINED
10
11#include "include/core/SkPath.h"
18
20class GrOpFlushState;
21class SkMatrix;
22
23namespace skgpu::ganesh {
24
25// Prepares GPU data for, and then draws a stroke's tessellated geometry. Renders strokes as
26// fixed-count triangle strip instances. Any extra triangles not needed by the instance are emitted
27// as degenerate triangles.
29public:
31
39 };
40
42
43 // Called before draw(). Prepares GPU buffers containing the geometry to tessellate.
44 //
45 // Returns the fixed number of edges the tessellator will draw per patch.
47 const SkMatrix& shaderMatrix,
49 int totalCombinedStrokeVerbCnt);
50
51 // Issues draw calls for the tessellated stroke. The caller is responsible for creating and
52 // binding a pipeline that uses this class's shader() before calling draw().
53 void draw(GrOpFlushState*) const;
54
55protected:
57
59
60 int fVertexCount = 0;
61
62 // Only used if sk_VertexID is not supported.
64};
65
66} // namespace skgpu::ganesh
67
68#endif // StrokeTessellator_DEFINED
Definition: SkPath.h:59
StrokeTessellator(PatchAttribs attribs)
void draw(GrOpFlushState *) const
void prepare(GrMeshDrawTarget *, const SkMatrix &shaderMatrix, PathStrokeList *, int totalCombinedStrokeVerbCnt)
sk_sp< const GrGpuBuffer > fVertexBufferIfNoIDSupport
DlColor color
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition: switches.h:57
PathStrokeList(const SkPath &path, const SkStrokeRec &stroke, const SkPMColor4f &color)