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 GrDrawTarget*, | 22 virtual bool canDrawPath(const GrDrawTarget*, |
23 const GrDrawState*, | 23 const GrPipelineBuilder*, |
24 const SkMatrix& viewMatrix, | 24 const SkMatrix& viewMatrix, |
25 const SkPath&, | 25 const SkPath&, |
26 const SkStrokeRec&, | 26 const SkStrokeRec&, |
27 bool antiAlias) const SK_OVERRIDE; | 27 bool antiAlias) const SK_OVERRIDE; |
28 | 28 |
29 private: | 29 private: |
30 | 30 |
31 virtual StencilSupport onGetStencilSupport(const GrDrawTarget*, | 31 virtual StencilSupport onGetStencilSupport(const GrDrawTarget*, |
32 const GrDrawState*, | 32 const GrPipelineBuilder*, |
33 const SkPath&, | 33 const SkPath&, |
34 const SkStrokeRec&) const SK_OVER
RIDE; | 34 const SkStrokeRec&) const SK_OVER
RIDE; |
35 | 35 |
36 virtual bool onDrawPath(GrDrawTarget*, | 36 virtual bool onDrawPath(GrDrawTarget*, |
37 GrDrawState*, | 37 GrPipelineBuilder*, |
38 GrColor, | 38 GrColor, |
39 const SkMatrix& viewMatrix, | 39 const SkMatrix& viewMatrix, |
40 const SkPath&, | 40 const SkPath&, |
41 const SkStrokeRec&, | 41 const SkStrokeRec&, |
42 bool antiAlias) SK_OVERRIDE; | 42 bool antiAlias) SK_OVERRIDE; |
43 | 43 |
44 virtual void onStencilPath(GrDrawTarget*, | 44 virtual void onStencilPath(GrDrawTarget*, |
45 GrDrawState*, | 45 GrPipelineBuilder*, |
46 const SkMatrix& viewMatrix, | 46 const SkMatrix& viewMatrix, |
47 const SkPath&, | 47 const SkPath&, |
48 const SkStrokeRec&) SK_OVERRIDE; | 48 const SkStrokeRec&) SK_OVERRIDE; |
49 | 49 |
50 bool internalDrawPath(GrDrawTarget*, | 50 bool internalDrawPath(GrDrawTarget*, |
51 GrDrawState*, | 51 GrPipelineBuilder*, |
52 GrColor, | 52 GrColor, |
53 const SkMatrix& viewMatrix, | 53 const SkMatrix& viewMatrix, |
54 const SkPath&, | 54 const SkPath&, |
55 const SkStrokeRec&, | 55 const SkStrokeRec&, |
56 bool stencilOnly); | 56 bool stencilOnly); |
57 | 57 |
58 bool createGeom(GrDrawTarget*, | 58 bool createGeom(GrDrawTarget*, |
59 GrDrawState*, | 59 GrPipelineBuilder*, |
60 GrPrimitiveType*, | 60 GrPrimitiveType*, |
61 int* vertexCnt, | 61 int* vertexCnt, |
62 int* indexCnt, | 62 int* indexCnt, |
63 GrDrawTarget::AutoReleaseGeometry*, | 63 GrDrawTarget::AutoReleaseGeometry*, |
64 const SkPath&, | 64 const SkPath&, |
65 const SkStrokeRec&, | 65 const SkStrokeRec&, |
66 SkScalar srcSpaceTol); | 66 SkScalar srcSpaceTol); |
67 | 67 |
68 bool fSeparateStencil; | 68 bool fSeparateStencil; |
69 bool fStencilWrapOps; | 69 bool fStencilWrapOps; |
70 | 70 |
71 typedef GrPathRenderer INHERITED; | 71 typedef GrPathRenderer INHERITED; |
72 }; | 72 }; |
73 | 73 |
74 #endif | 74 #endif |
OLD | NEW |