• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2020 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 GrStrokeHardwareTessellator_DEFINED
9 #define GrStrokeHardwareTessellator_DEFINED
10 
11 #include "src/gpu/GrVertexChunkArray.h"
12 #include "src/gpu/tessellate/GrStrokeTessellator.h"
13 
14 // Renders opaque, constant-color strokes by decomposing them into standalone tessellation patches.
15 // Each patch is either a "cubic" (single stroked bezier curve with butt caps) or a "join". Requires
16 // MSAA if antialiasing is desired.
17 class GrStrokeHardwareTessellator : public GrStrokeTessellator {
18 public:
GrStrokeHardwareTessellator(ShaderFlags shaderFlags,const SkMatrix & viewMatrix,PathStrokeList * pathStrokeList,const GrShaderCaps &)19     GrStrokeHardwareTessellator(ShaderFlags shaderFlags, const SkMatrix& viewMatrix,
20                                 PathStrokeList* pathStrokeList, const GrShaderCaps&)
21             : GrStrokeTessellator(GrStrokeTessellateShader::Mode::kHardwareTessellation,
22                                   shaderFlags, viewMatrix, pathStrokeList) {
23     }
24 
25     void prepare(GrMeshDrawOp::Target*, int totalCombinedVerbCnt) override;
26     void draw(GrOpFlushState*) const override;
27 
28 private:
29     GrVertexChunkArray fPatchChunks;
30 };
31 
32 #endif
33