OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef GrDefaultPathRenderer_DEFINED | 8 #ifndef GrDefaultPathRenderer_DEFINED |
9 #define GrDefaultPathRenderer_DEFINED | 9 #define GrDefaultPathRenderer_DEFINED |
10 | 10 |
11 #include "GrPathRenderer.h" | 11 #include "GrPathRenderer.h" |
12 #include "SkTemplates.h" | 12 #include "SkTemplates.h" |
13 | 13 |
14 /** | 14 /** |
15 * Subclass that renders the path using the stencil buffer to resolve fill rule
s | 15 * Subclass that renders the path using the stencil buffer to resolve fill rule
s |
16 * (e.g. winding, even-odd) | 16 * (e.g. winding, even-odd) |
17 */ | 17 */ |
18 class SK_API GrDefaultPathRenderer : public GrPathRenderer { | 18 class SK_API GrDefaultPathRenderer : public GrPathRenderer { |
19 public: | 19 public: |
20 GrDefaultPathRenderer(bool separateStencilSupport, bool stencilWrapOpsSuppor
t); | 20 GrDefaultPathRenderer(bool separateStencilSupport, bool stencilWrapOpsSuppor
t); |
21 | 21 |
22 virtual bool canDrawPath(const SkPath&, | 22 virtual bool canDrawPath(const GrDrawTarget*, |
| 23 const GrDrawState*, |
| 24 const SkPath&, |
23 const SkStrokeRec&, | 25 const SkStrokeRec&, |
24 const GrDrawTarget*, | |
25 bool antiAlias) const SK_OVERRIDE; | 26 bool antiAlias) const SK_OVERRIDE; |
26 | 27 |
27 private: | 28 private: |
28 | 29 |
29 virtual StencilSupport onGetStencilSupport(const SkPath&, | 30 virtual StencilSupport onGetStencilSupport(const GrDrawTarget*, |
30 const SkStrokeRec&, | 31 const GrDrawState*, |
31 const GrDrawTarget*) const SK_OVE
RRIDE; | 32 const SkPath&, |
| 33 const SkStrokeRec&) const SK_OVER
RIDE; |
32 | 34 |
33 virtual bool onDrawPath(const SkPath&, | 35 virtual bool onDrawPath(GrDrawTarget*, |
| 36 GrDrawState*, |
| 37 const SkPath&, |
34 const SkStrokeRec&, | 38 const SkStrokeRec&, |
35 GrDrawTarget*, | |
36 bool antiAlias) SK_OVERRIDE; | 39 bool antiAlias) SK_OVERRIDE; |
37 | 40 |
38 virtual void onStencilPath(const SkPath&, | 41 virtual void onStencilPath(GrDrawTarget*, |
39 const SkStrokeRec&, | 42 GrDrawState*, |
40 GrDrawTarget*) SK_OVERRIDE; | 43 const SkPath&, |
| 44 const SkStrokeRec&) SK_OVERRIDE; |
41 | 45 |
42 bool internalDrawPath(const SkPath&, | 46 bool internalDrawPath(GrDrawTarget*, |
| 47 GrDrawState*, |
| 48 const SkPath&, |
43 const SkStrokeRec&, | 49 const SkStrokeRec&, |
44 GrDrawTarget*, | |
45 bool stencilOnly); | 50 bool stencilOnly); |
46 | 51 |
47 bool createGeom(const SkPath&, | 52 bool createGeom(GrDrawTarget*, |
48 const SkStrokeRec&, | 53 GrDrawState*, |
49 SkScalar srcSpaceTol, | |
50 GrDrawTarget*, | |
51 GrPrimitiveType*, | 54 GrPrimitiveType*, |
52 int* vertexCnt, | 55 int* vertexCnt, |
53 int* indexCnt, | 56 int* indexCnt, |
54 GrDrawTarget::AutoReleaseGeometry*); | 57 GrDrawTarget::AutoReleaseGeometry*, |
| 58 const SkPath&, |
| 59 const SkStrokeRec&, |
| 60 SkScalar srcSpaceTol); |
55 | 61 |
56 bool fSeparateStencil; | 62 bool fSeparateStencil; |
57 bool fStencilWrapOps; | 63 bool fStencilWrapOps; |
58 | 64 |
59 typedef GrPathRenderer INHERITED; | 65 typedef GrPathRenderer INHERITED; |
60 }; | 66 }; |
61 | 67 |
62 #endif | 68 #endif |
OLD | NEW |