• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2012 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 GrBuiltInPathRenderer_DEFINED
9 #define GrBuiltInPathRenderer_DEFINED
10 
11 #include "GrPathRenderer.h"
12 
13 class GrContext;
14 class GrGpu;
15 
16 /**
17  * Uses GrGpu::stencilPath followed by a cover rectangle. This subclass doesn't apply AA; it relies
18  * on the target having MSAA if AA is desired.
19  */
20 class GrStencilAndCoverPathRenderer : public GrPathRenderer {
21 public:
22 
23     static GrPathRenderer* Create(GrResourceProvider*, const GrCaps&);
24 
25 
26 private:
onGetStencilSupport(const GrShape &)27     StencilSupport onGetStencilSupport(const GrShape&) const override {
28         return GrPathRenderer::kStencilOnly_StencilSupport;
29     }
30 
31     bool onCanDrawPath(const CanDrawPathArgs&) const override;
32 
33     bool onDrawPath(const DrawPathArgs&) override;
34 
35     void onStencilPath(const StencilPathArgs&) override;
36 
37     GrStencilAndCoverPathRenderer(GrResourceProvider*);
38 
39     GrResourceProvider* fResourceProvider;
40 
41     typedef GrPathRenderer INHERITED;
42 };
43 
44 #endif
45