senorblanco | d6ed19c | 2015-02-26 06:58:17 -0800 | [diff] [blame] | 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 GrTessellatingPathRenderer_DEFINED |
| 9 | #define GrTessellatingPathRenderer_DEFINED |
| 10 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 11 | #include "src/gpu/GrPathRenderer.h" |
senorblanco | d6ed19c | 2015-02-26 06:58:17 -0800 | [diff] [blame] | 12 | |
| 13 | /** |
| 14 | * Subclass that renders the path by converting to screen-space trapezoids plus |
| 15 | * extra 1-pixel geometry for AA. |
| 16 | */ |
Brian Salomon | 57f211b | 2019-08-21 15:21:09 -0400 | [diff] [blame] | 17 | class GrTessellatingPathRenderer : public GrPathRenderer { |
senorblanco | d6ed19c | 2015-02-26 06:58:17 -0800 | [diff] [blame] | 18 | public: |
| 19 | GrTessellatingPathRenderer(); |
Stephen White | 8a3c059 | 2019-05-29 11:26:16 -0400 | [diff] [blame] | 20 | #if GR_TEST_UTILS |
| 21 | void setMaxVerbCount(int maxVerbCount) { fMaxVerbCount = maxVerbCount; } |
| 22 | #endif |
senorblanco | d6ed19c | 2015-02-26 06:58:17 -0800 | [diff] [blame] | 23 | |
bsalomon | 0aff2fa | 2015-07-31 06:48:27 -0700 | [diff] [blame] | 24 | private: |
Chris Dalton | 5ed4423 | 2017-09-07 13:22:46 -0600 | [diff] [blame] | 25 | CanDrawPath onCanDrawPath(const CanDrawPathArgs&) const override; |
senorblanco | d6ed19c | 2015-02-26 06:58:17 -0800 | [diff] [blame] | 26 | |
bsalomon | 8acedde | 2016-06-24 10:42:16 -0700 | [diff] [blame] | 27 | StencilSupport onGetStencilSupport(const GrShape&) const override { |
robertphillips | e7d4b2f | 2015-08-13 07:57:10 -0700 | [diff] [blame] | 28 | return GrPathRenderer::kNoSupport_StencilSupport; |
| 29 | } |
senorblanco | d6ed19c | 2015-02-26 06:58:17 -0800 | [diff] [blame] | 30 | |
bsalomon | 0aff2fa | 2015-07-31 06:48:27 -0700 | [diff] [blame] | 31 | bool onDrawPath(const DrawPathArgs&) override; |
Stephen White | 8a3c059 | 2019-05-29 11:26:16 -0400 | [diff] [blame] | 32 | int fMaxVerbCount; |
senorblanco | d6ed19c | 2015-02-26 06:58:17 -0800 | [diff] [blame] | 33 | |
| 34 | typedef GrPathRenderer INHERITED; |
| 35 | }; |
| 36 | |
| 37 | #endif |