blob: 1ea26c4e8e57b8653d3ac31fe8c3c7721f3c815d [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*,
joshualitt8059eb92014-12-29 15:10:07 -080030 const SkMatrix& viewMatrix,
joshualitt9853cce2014-11-17 14:22:48 -080031 const SkPath&,
robertphillips@google.come79f3202014-02-11 16:30:21 +000032 const SkStrokeRec&,
bsalomon@google.comded4f4b2012-06-28 18:48:06 +000033 bool antiAlias) const SK_OVERRIDE;
34
bsalomon@google.comded4f4b2012-06-28 18:48:06 +000035protected:
joshualitt9853cce2014-11-17 14:22:48 -080036 virtual StencilSupport onGetStencilSupport(const GrDrawTarget*,
37 const GrDrawState*,
38 const SkPath&,
39 const SkStrokeRec&) const SK_OVERRIDE;
bsalomon@google.com45a15f52012-12-10 19:10:17 +000040
joshualitt9853cce2014-11-17 14:22:48 -080041 virtual bool onDrawPath(GrDrawTarget*,
42 GrDrawState*,
joshualitt2e3b3e32014-12-09 13:31:14 -080043 GrColor,
joshualitt8059eb92014-12-29 15:10:07 -080044 const SkMatrix& viewMatrix,
joshualitt9853cce2014-11-17 14:22:48 -080045 const SkPath&,
robertphillips@google.come79f3202014-02-11 16:30:21 +000046 const SkStrokeRec&,
bsalomon@google.comded4f4b2012-06-28 18:48:06 +000047 bool antiAlias) SK_OVERRIDE;
48
joshualitt9853cce2014-11-17 14:22:48 -080049 virtual void onStencilPath(GrDrawTarget*,
50 GrDrawState*,
joshualitt8059eb92014-12-29 15:10:07 -080051 const SkMatrix& viewMatrix,
joshualitt9853cce2014-11-17 14:22:48 -080052 const SkPath&,
53 const SkStrokeRec&) SK_OVERRIDE;
bsalomon@google.com45a15f52012-12-10 19:10:17 +000054
bsalomon@google.comded4f4b2012-06-28 18:48:06 +000055private:
bsalomon@google.com45a15f52012-12-10 19:10:17 +000056 GrStencilAndCoverPathRenderer(GrGpu*);
bsalomon@google.comded4f4b2012-06-28 18:48:06 +000057
58 GrGpu* fGpu;
59
60 typedef GrPathRenderer INHERITED;
61};
62
63#endif