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 "SkTypes.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 private:
23 
24     StencilSupport onGetStencilSupport(const SkPath&, const GrStrokeInfo&) const override;
25 
26     bool onCanDrawPath(const CanDrawPathArgs&) const override;
27 
28     bool onDrawPath(const DrawPathArgs&) override;
29 
30     void onStencilPath(const StencilPathArgs&) override;
31 
32     bool internalDrawPath(GrDrawTarget*,
33                           GrPipelineBuilder*,
34                           GrColor,
35                           const SkMatrix& viewMatrix,
36                           const SkPath&,
37                           const GrStrokeInfo&,
38                           bool stencilOnly);
39 
40     bool    fSeparateStencil;
41     bool    fStencilWrapOps;
42 
43     typedef GrPathRenderer INHERITED;
44 };
45 
46 #endif
47