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 "src/gpu/GrPathRenderer.h"
12
13class GrGpu;
14class GrResourceProvider;
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 */
20class GrStencilAndCoverPathRenderer : public GrPathRenderer {
21public:
22
23 static GrPathRenderer* Create(GrResourceProvider*, const GrCaps&);
24
25
26private:
27 StencilSupport onGetStencilSupport(const GrShape&) const override {
28 return GrPathRenderer::kStencilOnly_StencilSupport;
29 }
30
31 CanDrawPath 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