1 /* 2 * Copyright 2019 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 TessellationPathRenderer_DEFINED 9 #define TessellationPathRenderer_DEFINED 10 11 #include "include/gpu/GrTypes.h" 12 #include "src/gpu/v1/PathRenderer.h" 13 14 class GrCaps; 15 16 namespace skgpu::v1 { 17 18 // This is the tie-in point for path rendering via PathTessellateOp. This path renderer draws 19 // paths using a hybrid Red Book "stencil, then cover" method. Curves get linearized by GPU 20 // tessellation shaders. This path renderer doesn't apply analytic AA, so it requires MSAA if AA is 21 // desired. 22 class TessellationPathRenderer final : public PathRenderer { 23 public: 24 static bool IsSupported(const GrCaps&); 25 name()26 const char* name() const override { return "Tessellation"; } 27 28 private: 29 StencilSupport onGetStencilSupport(const GrStyledShape&) const override; 30 CanDrawPath onCanDrawPath(const CanDrawPathArgs&) const override; 31 bool onDrawPath(const DrawPathArgs&) override; 32 void onStencilPath(const StencilPathArgs&) override; 33 }; 34 35 } // namespace skgpu::v1 36 37 #endif // TessellationPathRenderer_DEFINED 38