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*, | |
23 const GrPipelineBuilder*, | |
24 const SkMatrix& viewMatrix, | |
25 const SkPath&, | |
26 const GrStrokeInfo&, | |
27 bool antiAlias) const override; | |
28 | |
29 private: | 22 private: |
30 | 23 |
31 virtual StencilSupport onGetStencilSupport(const GrDrawTarget*, | 24 virtual StencilSupport onGetStencilSupport(const GrDrawTarget*, |
32 const GrPipelineBuilder*, | 25 const GrPipelineBuilder*, |
33 const SkPath&, | 26 const SkPath&, |
34 const GrStrokeInfo&) const overri
de; | 27 const GrStrokeInfo&) const overri
de; |
35 | 28 |
36 virtual bool onDrawPath(GrDrawTarget*, | 29 bool onCanDrawPath(const CanDrawPathArgs&) const override; |
37 GrPipelineBuilder*, | |
38 GrColor, | |
39 const SkMatrix& viewMatrix, | |
40 const SkPath&, | |
41 const GrStrokeInfo&, | |
42 bool antiAlias) override; | |
43 | 30 |
44 virtual void onStencilPath(GrDrawTarget*, | 31 bool onDrawPath(const DrawPathArgs&) override; |
45 GrPipelineBuilder*, | 32 |
46 const SkMatrix& viewMatrix, | 33 void onStencilPath(const StencilPathArgs&) override; |
47 const SkPath&, | |
48 const GrStrokeInfo&) override; | |
49 | 34 |
50 bool internalDrawPath(GrDrawTarget*, | 35 bool internalDrawPath(GrDrawTarget*, |
51 GrPipelineBuilder*, | 36 GrPipelineBuilder*, |
52 GrColor, | 37 GrColor, |
53 const SkMatrix& viewMatrix, | 38 const SkMatrix& viewMatrix, |
54 const SkPath&, | 39 const SkPath&, |
55 const GrStrokeInfo&, | 40 const GrStrokeInfo&, |
56 bool stencilOnly); | 41 bool stencilOnly); |
57 | 42 |
58 bool fSeparateStencil; | 43 bool fSeparateStencil; |
59 bool fStencilWrapOps; | 44 bool fStencilWrapOps; |
60 | 45 |
61 typedef GrPathRenderer INHERITED; | 46 typedef GrPathRenderer INHERITED; |
62 }; | 47 }; |
63 | 48 |
64 #endif | 49 #endif |
OLD | NEW |