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