bsalomon@google.com | 3008519 | 2011-08-19 15:42:31 +0000 | [diff] [blame] | 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 "GrPathRenderer.h" |
ethannicholas | 6536ae5 | 2016-05-02 12:16:49 -0700 | [diff] [blame] | 12 | #include "GrPathStencilSettings.h" |
bungeman | f3c15b7 | 2015-08-19 11:56:48 -0700 | [diff] [blame] | 13 | #include "SkTypes.h" |
bsalomon@google.com | 3008519 | 2011-08-19 15:42:31 +0000 | [diff] [blame] | 14 | |
| 15 | /** |
bsalomon@google.com | 45a15f5 | 2012-12-10 19:10:17 +0000 | [diff] [blame] | 16 | * Subclass that renders the path using the stencil buffer to resolve fill rules |
| 17 | * (e.g. winding, even-odd) |
bsalomon@google.com | 3008519 | 2011-08-19 15:42:31 +0000 | [diff] [blame] | 18 | */ |
commit-bot@chromium.org | d28063e | 2013-08-20 12:23:06 +0000 | [diff] [blame] | 19 | class SK_API GrDefaultPathRenderer : public GrPathRenderer { |
bsalomon@google.com | 3008519 | 2011-08-19 15:42:31 +0000 | [diff] [blame] | 20 | public: |
Brian Salomon | 15b2509 | 2017-05-08 11:10:53 -0400 | [diff] [blame] | 21 | GrDefaultPathRenderer(); |
bsalomon@google.com | 3008519 | 2011-08-19 15:42:31 +0000 | [diff] [blame] | 22 | |
bsalomon@google.com | 3008519 | 2011-08-19 15:42:31 +0000 | [diff] [blame] | 23 | private: |
bsalomon | 8acedde | 2016-06-24 10:42:16 -0700 | [diff] [blame] | 24 | StencilSupport onGetStencilSupport(const GrShape&) const override; |
bsalomon@google.com | 45a15f5 | 2012-12-10 19:10:17 +0000 | [diff] [blame] | 25 | |
Chris Dalton | 5ed4423 | 2017-09-07 13:22:46 -0600 | [diff] [blame] | 26 | CanDrawPath onCanDrawPath(const CanDrawPathArgs&) const override; |
bsalomon@google.com | 3008519 | 2011-08-19 15:42:31 +0000 | [diff] [blame] | 27 | |
bsalomon | 0aff2fa | 2015-07-31 06:48:27 -0700 | [diff] [blame] | 28 | bool onDrawPath(const DrawPathArgs&) override; |
| 29 | |
| 30 | void onStencilPath(const StencilPathArgs&) override; |
bsalomon@google.com | 45a15f5 | 2012-12-10 19:10:17 +0000 | [diff] [blame] | 31 | |
Brian Osman | 1105224 | 2016-10-27 14:47:55 -0400 | [diff] [blame] | 32 | bool internalDrawPath(GrRenderTargetContext*, |
Brian Salomon | 82f4431 | 2017-01-11 13:42:54 -0500 | [diff] [blame] | 33 | GrPaint&&, |
Brian Salomon | 0e8fc8b | 2016-12-09 15:10:07 -0500 | [diff] [blame] | 34 | GrAAType, |
robertphillips | d2b6d64 | 2016-07-21 08:55:08 -0700 | [diff] [blame] | 35 | const GrUserStencilSettings&, |
cdalton | 862cff3 | 2016-05-12 15:09:48 -0700 | [diff] [blame] | 36 | const GrClip&, |
joshualitt | 8059eb9 | 2014-12-29 15:10:07 -0800 | [diff] [blame] | 37 | const SkMatrix& viewMatrix, |
bsalomon | 8acedde | 2016-06-24 10:42:16 -0700 | [diff] [blame] | 38 | const GrShape&, |
bsalomon@google.com | c2099d2 | 2012-03-02 21:26:50 +0000 | [diff] [blame] | 39 | bool stencilOnly); |
| 40 | |
bsalomon@google.com | 3008519 | 2011-08-19 15:42:31 +0000 | [diff] [blame] | 41 | typedef GrPathRenderer INHERITED; |
| 42 | }; |
| 43 | |
| 44 | #endif |