bsalomon@google.com | ded4f4b | 2012-06-28 18:48:06 +0000 | [diff] [blame] | 1 | |
| 2 | /* |
| 3 | * Copyright 2012 Google Inc. |
| 4 | * |
| 5 | * Use of this source code is governed by a BSD-style license that can be |
| 6 | * found in the LICENSE file. |
| 7 | */ |
| 8 | |
| 9 | #ifndef GrBuiltInPathRenderer_DEFINED |
| 10 | #define GrBuiltInPathRenderer_DEFINED |
| 11 | |
| 12 | #include "GrPathRenderer.h" |
| 13 | |
| 14 | class GrContext; |
| 15 | class GrGpu; |
| 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@google.com | 45a15f5 | 2012-12-10 19:10:17 +0000 | [diff] [blame] | 24 | static GrPathRenderer* Create(GrContext*); |
bsalomon@google.com | ded4f4b | 2012-06-28 18:48:06 +0000 | [diff] [blame] | 25 | |
| 26 | virtual ~GrStencilAndCoverPathRenderer(); |
| 27 | |
bsalomon@google.com | 45a15f5 | 2012-12-10 19:10:17 +0000 | [diff] [blame] | 28 | virtual bool canDrawPath(const SkPath&, |
sugoi@google.com | 5f74cf8 | 2012-12-17 21:16:45 +0000 | [diff] [blame] | 29 | const SkStrokeRec&, |
bsalomon@google.com | 45a15f5 | 2012-12-10 19:10:17 +0000 | [diff] [blame] | 30 | const GrDrawTarget*, |
bsalomon@google.com | ded4f4b | 2012-06-28 18:48:06 +0000 | [diff] [blame] | 31 | bool antiAlias) const SK_OVERRIDE; |
| 32 | |
bsalomon@google.com | ded4f4b | 2012-06-28 18:48:06 +0000 | [diff] [blame] | 33 | protected: |
bsalomon@google.com | 45a15f5 | 2012-12-10 19:10:17 +0000 | [diff] [blame] | 34 | virtual StencilSupport onGetStencilSupport(const SkPath&, |
sugoi@google.com | 5f74cf8 | 2012-12-17 21:16:45 +0000 | [diff] [blame] | 35 | const SkStrokeRec&, |
bsalomon@google.com | 45a15f5 | 2012-12-10 19:10:17 +0000 | [diff] [blame] | 36 | const GrDrawTarget*) const SK_OVERRIDE; |
| 37 | |
| 38 | virtual bool onDrawPath(const SkPath&, |
sugoi@google.com | 5f74cf8 | 2012-12-17 21:16:45 +0000 | [diff] [blame] | 39 | const SkStrokeRec&, |
bsalomon@google.com | 45a15f5 | 2012-12-10 19:10:17 +0000 | [diff] [blame] | 40 | GrDrawTarget*, |
bsalomon@google.com | ded4f4b | 2012-06-28 18:48:06 +0000 | [diff] [blame] | 41 | bool antiAlias) SK_OVERRIDE; |
| 42 | |
skia.committer@gmail.com | c7b4be7 | 2012-12-11 02:01:20 +0000 | [diff] [blame] | 43 | virtual void onStencilPath(const SkPath&, |
sugoi@google.com | 5f74cf8 | 2012-12-17 21:16:45 +0000 | [diff] [blame] | 44 | const SkStrokeRec&, |
bsalomon@google.com | 45a15f5 | 2012-12-10 19:10:17 +0000 | [diff] [blame] | 45 | GrDrawTarget*) SK_OVERRIDE; |
| 46 | |
bsalomon@google.com | ded4f4b | 2012-06-28 18:48:06 +0000 | [diff] [blame] | 47 | private: |
bsalomon@google.com | 45a15f5 | 2012-12-10 19:10:17 +0000 | [diff] [blame] | 48 | GrStencilAndCoverPathRenderer(GrGpu*); |
bsalomon@google.com | ded4f4b | 2012-06-28 18:48:06 +0000 | [diff] [blame] | 49 | |
| 50 | GrGpu* fGpu; |
| 51 | |
| 52 | typedef GrPathRenderer INHERITED; |
| 53 | }; |
| 54 | |
| 55 | #endif |