| 1 | /* |
|---|---|
| 2 | * Copyright 2011 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 GrDefaultPathRenderer_DEFINED |
| 9 | #define GrDefaultPathRenderer_DEFINED |
| 10 | |
| 11 | #include "include/core/SkTypes.h" |
| 12 | #include "src/gpu/GrPathRenderer.h" |
| 13 | #include "src/gpu/ops/GrPathStencilSettings.h" |
| 14 | |
| 15 | /** |
| 16 | * Subclass that renders the path using the stencil buffer to resolve fill rules |
| 17 | * (e.g. winding, even-odd) |
| 18 | */ |
| 19 | class GrDefaultPathRenderer : public GrPathRenderer { |
| 20 | public: |
| 21 | GrDefaultPathRenderer(); |
| 22 | |
| 23 | private: |
| 24 | StencilSupport onGetStencilSupport(const GrShape&) const override; |
| 25 | |
| 26 | CanDrawPath onCanDrawPath(const CanDrawPathArgs&) const override; |
| 27 | |
| 28 | bool onDrawPath(const DrawPathArgs&) override; |
| 29 | |
| 30 | void onStencilPath(const StencilPathArgs&) override; |
| 31 | |
| 32 | bool internalDrawPath(GrRenderTargetContext*, |
| 33 | GrPaint&&, |
| 34 | GrAAType, |
| 35 | const GrUserStencilSettings&, |
| 36 | const GrClip&, |
| 37 | const SkMatrix& viewMatrix, |
| 38 | const GrShape&, |
| 39 | bool stencilOnly); |
| 40 | |
| 41 | typedef GrPathRenderer INHERITED; |
| 42 | }; |
| 43 | |
| 44 | #endif |
| 45 |