blob: dacdcd069541e353fd6e6b8f0f2c877fb7fa526a [file] [log] [blame]
bsalomon@google.comded4f4b2012-06-28 18:48:06 +00001
2/*
3 * Copyright 2012 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8
9#ifndef GrBuiltInPathRenderer_DEFINED
10#define GrBuiltInPathRenderer_DEFINED
11
12#include "GrPathRenderer.h"
13
14class GrContext;
15class GrGpu;
16
17/**
18 * Uses GrGpu::stencilPath followed by a cover rectangle. This subclass doesn't apply AA; it relies
19 * on the target having MSAA if AA is desired.
20 */
21class GrStencilAndCoverPathRenderer : public GrPathRenderer {
22public:
23
bsalomon@google.com45a15f52012-12-10 19:10:17 +000024 static GrPathRenderer* Create(GrContext*);
bsalomon@google.comded4f4b2012-06-28 18:48:06 +000025
26 virtual ~GrStencilAndCoverPathRenderer();
27
joshualitt9853cce2014-11-17 14:22:48 -080028 virtual bool canDrawPath(const GrDrawTarget*,
29 const GrDrawState*,
30 const SkPath&,
robertphillips@google.come79f3202014-02-11 16:30:21 +000031 const SkStrokeRec&,
bsalomon@google.comded4f4b2012-06-28 18:48:06 +000032 bool antiAlias) const SK_OVERRIDE;
33
bsalomon@google.comded4f4b2012-06-28 18:48:06 +000034protected:
joshualitt9853cce2014-11-17 14:22:48 -080035 virtual StencilSupport onGetStencilSupport(const GrDrawTarget*,
36 const GrDrawState*,
37 const SkPath&,
38 const SkStrokeRec&) const SK_OVERRIDE;
bsalomon@google.com45a15f52012-12-10 19:10:17 +000039
joshualitt9853cce2014-11-17 14:22:48 -080040 virtual bool onDrawPath(GrDrawTarget*,
41 GrDrawState*,
42 const SkPath&,
robertphillips@google.come79f3202014-02-11 16:30:21 +000043 const SkStrokeRec&,
bsalomon@google.comded4f4b2012-06-28 18:48:06 +000044 bool antiAlias) SK_OVERRIDE;
45
joshualitt9853cce2014-11-17 14:22:48 -080046 virtual void onStencilPath(GrDrawTarget*,
47 GrDrawState*,
48 const SkPath&,
49 const SkStrokeRec&) SK_OVERRIDE;
bsalomon@google.com45a15f52012-12-10 19:10:17 +000050
bsalomon@google.comded4f4b2012-06-28 18:48:06 +000051private:
bsalomon@google.com45a15f52012-12-10 19:10:17 +000052 GrStencilAndCoverPathRenderer(GrGpu*);
bsalomon@google.comded4f4b2012-06-28 18:48:06 +000053
54 GrGpu* fGpu;
55
56 typedef GrPathRenderer INHERITED;
57};
58
59#endif