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