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