bsalomon@google.com | ded4f4b | 2012-06-28 18:48:06 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2012 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 GrBuiltInPathRenderer_DEFINED |
| 9 | #define GrBuiltInPathRenderer_DEFINED |
| 10 | |
| 11 | #include "GrPathRenderer.h" |
| 12 | |
| 13 | class GrContext; |
| 14 | class GrGpu; |
Brian Salomon | 653f42f | 2018-07-10 10:07:31 -0400 | [diff] [blame] | 15 | class GrResourceProvider; |
bsalomon@google.com | ded4f4b | 2012-06-28 18:48:06 +0000 | [diff] [blame] | 16 | |
| 17 | /** |
| 18 | * Uses GrGpu::stencilPath followed by a cover rectangle. This subclass doesn't apply AA; it relies |
| 19 | * on the target having MSAA if AA is desired. |
| 20 | */ |
| 21 | class GrStencilAndCoverPathRenderer : public GrPathRenderer { |
| 22 | public: |
| 23 | |
bsalomon | 706f08f | 2015-05-22 07:35:58 -0700 | [diff] [blame] | 24 | static GrPathRenderer* Create(GrResourceProvider*, const GrCaps&); |
bsalomon@google.com | ded4f4b | 2012-06-28 18:48:06 +0000 | [diff] [blame] | 25 | |
bsalomon@google.com | ded4f4b | 2012-06-28 18:48:06 +0000 | [diff] [blame] | 26 | |
bsalomon | 0aff2fa | 2015-07-31 06:48:27 -0700 | [diff] [blame] | 27 | private: |
bsalomon | 8acedde | 2016-06-24 10:42:16 -0700 | [diff] [blame] | 28 | StencilSupport onGetStencilSupport(const GrShape&) const override { |
robertphillips | e7d4b2f | 2015-08-13 07:57:10 -0700 | [diff] [blame] | 29 | return GrPathRenderer::kStencilOnly_StencilSupport; |
| 30 | } |
bsalomon@google.com | 45a15f5 | 2012-12-10 19:10:17 +0000 | [diff] [blame] | 31 | |
Chris Dalton | 5ed4423 | 2017-09-07 13:22:46 -0600 | [diff] [blame] | 32 | CanDrawPath onCanDrawPath(const CanDrawPathArgs&) const override; |
bsalomon@google.com | ded4f4b | 2012-06-28 18:48:06 +0000 | [diff] [blame] | 33 | |
bsalomon | 0aff2fa | 2015-07-31 06:48:27 -0700 | [diff] [blame] | 34 | bool onDrawPath(const DrawPathArgs&) override; |
bsalomon@google.com | 45a15f5 | 2012-12-10 19:10:17 +0000 | [diff] [blame] | 35 | |
bsalomon | 0aff2fa | 2015-07-31 06:48:27 -0700 | [diff] [blame] | 36 | void onStencilPath(const StencilPathArgs&) override; |
| 37 | |
bsalomon | 706f08f | 2015-05-22 07:35:58 -0700 | [diff] [blame] | 38 | GrStencilAndCoverPathRenderer(GrResourceProvider*); |
bsalomon@google.com | ded4f4b | 2012-06-28 18:48:06 +0000 | [diff] [blame] | 39 | |
bsalomon | 706f08f | 2015-05-22 07:35:58 -0700 | [diff] [blame] | 40 | GrResourceProvider* fResourceProvider; |
bsalomon@google.com | ded4f4b | 2012-06-28 18:48:06 +0000 | [diff] [blame] | 41 | |
| 42 | typedef GrPathRenderer INHERITED; |
| 43 | }; |
| 44 | |
| 45 | #endif |