| 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 "src/gpu/GrPathRenderer.h" |
| 12 | |
| 13 | class GrGpu; |
| 14 | class GrResourceProvider; |
| 15 | |
| 16 | /** |
| 17 | * Uses GrGpu::stencilPath followed by a cover rectangle. This subclass doesn't apply AA; it relies |
| 18 | * on the target having MSAA if AA is desired. |
| 19 | */ |
| 20 | class GrStencilAndCoverPathRenderer : public GrPathRenderer { |
| 21 | public: |
| 22 | const char* name() const final { return "NVPR"; } |
| 23 | |
| 24 | static GrPathRenderer* Create(GrResourceProvider*, const GrCaps&); |
| 25 | |
| 26 | |
| 27 | private: |
| 28 | StencilSupport onGetStencilSupport(const GrStyledShape&) const override { |
| 29 | return GrPathRenderer::kStencilOnly_StencilSupport; |
| 30 | } |
| 31 | |
| 32 | CanDrawPath onCanDrawPath(const CanDrawPathArgs&) const override; |
| 33 | |
| 34 | bool onDrawPath(const DrawPathArgs&) override; |
| 35 | |
| 36 | void onStencilPath(const StencilPathArgs&) override; |
| 37 | |
| 38 | GrStencilAndCoverPathRenderer(GrResourceProvider*); |
| 39 | |
| 40 | GrResourceProvider* fResourceProvider; |
| 41 | |
| 42 | typedef GrPathRenderer INHERITED; |
| 43 | }; |
| 44 | |
| 45 | #endif |
| 46 |