blob: a28b6aa8abb2bc09df151bb9f2ac5c145910475a [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*,
egdaniel8dd688b2015-01-22 10:16:09 -080029 const GrPipelineBuilder*,
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&,
mtklein36352bf2015-03-25 18:17:31 -070033 bool antiAlias) const override;
bsalomon@google.comded4f4b2012-06-28 18:48:06 +000034
bsalomon@google.comded4f4b2012-06-28 18:48:06 +000035protected:
joshualitt9853cce2014-11-17 14:22:48 -080036 virtual StencilSupport onGetStencilSupport(const GrDrawTarget*,
egdaniel8dd688b2015-01-22 10:16:09 -080037 const GrPipelineBuilder*,
joshualitt9853cce2014-11-17 14:22:48 -080038 const SkPath&,
mtklein36352bf2015-03-25 18:17:31 -070039 const SkStrokeRec&) const override;
bsalomon@google.com45a15f52012-12-10 19:10:17 +000040
joshualitt9853cce2014-11-17 14:22:48 -080041 virtual bool onDrawPath(GrDrawTarget*,
egdaniel8dd688b2015-01-22 10:16:09 -080042 GrPipelineBuilder*,
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&,
mtklein36352bf2015-03-25 18:17:31 -070047 bool antiAlias) override;
bsalomon@google.comded4f4b2012-06-28 18:48:06 +000048
joshualitt9853cce2014-11-17 14:22:48 -080049 virtual void onStencilPath(GrDrawTarget*,
egdaniel8dd688b2015-01-22 10:16:09 -080050 GrPipelineBuilder*,
joshualitt8059eb92014-12-29 15:10:07 -080051 const SkMatrix& viewMatrix,
joshualitt9853cce2014-11-17 14:22:48 -080052 const SkPath&,
mtklein36352bf2015-03-25 18:17:31 -070053 const SkStrokeRec&) 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