1 /*
2  * Copyright 2015 Google Inc.
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 TriangulatingPathRenderer_DEFINED
9 #define TriangulatingPathRenderer_DEFINED
10 
11 #include "src/gpu/v1/PathRenderer.h"
12 
13 namespace skgpu::v1 {
14 
15 /**
16  *  Subclass that renders the path by converting to screen-space trapezoids plus
17  *  extra 1-pixel geometry for AA.
18  */
19 class TriangulatingPathRenderer final : public PathRenderer {
20 public:
21     TriangulatingPathRenderer();
22 #if GR_TEST_UTILS
setMaxVerbCount(int maxVerbCount)23     void setMaxVerbCount(int maxVerbCount) { fMaxVerbCount = maxVerbCount; }
24 #endif
25 
26     const char* name() const override { return "Triangulating"; }
27 
28 private:
29     CanDrawPath onCanDrawPath(const CanDrawPathArgs&) const override;
30 
31     StencilSupport onGetStencilSupport(const GrStyledShape&) const override {
32         return kNoSupport_StencilSupport;
33     }
34 
35     bool onDrawPath(const DrawPathArgs&) override;
36 
37     int fMaxVerbCount;
38 };
39 
40 } // namespace skgpu::v1
41 
42 #endif // TriangulatingPathRenderer_DEFINED
43