| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #ifndef GrBuiltInPathRenderer_DEFINED | 9 #ifndef GrBuiltInPathRenderer_DEFINED |
| 10 #define GrBuiltInPathRenderer_DEFINED | 10 #define GrBuiltInPathRenderer_DEFINED |
| 11 | 11 |
| 12 #include "GrPathRenderer.h" | 12 #include "GrPathRenderer.h" |
| 13 | 13 |
| 14 class GrContext; | 14 class GrContext; |
| 15 class GrGpu; | 15 class GrGpu; |
| 16 | 16 |
| 17 /** | 17 /** |
| 18 * Uses GrGpu::stencilPath followed by a cover rectangle. This subclass doesn't
apply AA; it relies | 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. | 19 * on the target having MSAA if AA is desired. |
| 20 */ | 20 */ |
| 21 class GrStencilAndCoverPathRenderer : public GrPathRenderer { | 21 class GrStencilAndCoverPathRenderer : public GrPathRenderer { |
| 22 public: | 22 public: |
| 23 | 23 |
| 24 static GrPathRenderer* Create(GrContext*); | 24 static GrPathRenderer* Create(GrContext*); |
| 25 | 25 |
| 26 virtual ~GrStencilAndCoverPathRenderer(); | 26 virtual ~GrStencilAndCoverPathRenderer(); |
| 27 | 27 |
| 28 virtual bool canDrawPath(const GrDrawTarget*, | 28 virtual bool canDrawPath(const GrDrawTarget*, |
| 29 const GrDrawState*, | 29 const GrDrawState*, |
| 30 const SkMatrix& viewMatrix, |
| 30 const SkPath&, | 31 const SkPath&, |
| 31 const SkStrokeRec&, | 32 const SkStrokeRec&, |
| 32 bool antiAlias) const SK_OVERRIDE; | 33 bool antiAlias) const SK_OVERRIDE; |
| 33 | 34 |
| 34 protected: | 35 protected: |
| 35 virtual StencilSupport onGetStencilSupport(const GrDrawTarget*, | 36 virtual StencilSupport onGetStencilSupport(const GrDrawTarget*, |
| 36 const GrDrawState*, | 37 const GrDrawState*, |
| 37 const SkPath&, | 38 const SkPath&, |
| 38 const SkStrokeRec&) const SK_OVER
RIDE; | 39 const SkStrokeRec&) const SK_OVER
RIDE; |
| 39 | 40 |
| 40 virtual bool onDrawPath(GrDrawTarget*, | 41 virtual bool onDrawPath(GrDrawTarget*, |
| 41 GrDrawState*, | 42 GrDrawState*, |
| 42 GrColor, | 43 GrColor, |
| 44 const SkMatrix& viewMatrix, |
| 43 const SkPath&, | 45 const SkPath&, |
| 44 const SkStrokeRec&, | 46 const SkStrokeRec&, |
| 45 bool antiAlias) SK_OVERRIDE; | 47 bool antiAlias) SK_OVERRIDE; |
| 46 | 48 |
| 47 virtual void onStencilPath(GrDrawTarget*, | 49 virtual void onStencilPath(GrDrawTarget*, |
| 48 GrDrawState*, | 50 GrDrawState*, |
| 51 const SkMatrix& viewMatrix, |
| 49 const SkPath&, | 52 const SkPath&, |
| 50 const SkStrokeRec&) SK_OVERRIDE; | 53 const SkStrokeRec&) SK_OVERRIDE; |
| 51 | 54 |
| 52 private: | 55 private: |
| 53 GrStencilAndCoverPathRenderer(GrGpu*); | 56 GrStencilAndCoverPathRenderer(GrGpu*); |
| 54 | 57 |
| 55 GrGpu* fGpu; | 58 GrGpu* fGpu; |
| 56 | 59 |
| 57 typedef GrPathRenderer INHERITED; | 60 typedef GrPathRenderer INHERITED; |
| 58 }; | 61 }; |
| 59 | 62 |
| 60 #endif | 63 #endif |
| OLD | NEW |