blob: 8649be2f59bcc175387364281b3617603c714fcf [file] [log] [blame]
bsalomon@google.comded4f4b2012-06-28 18:48:06 +00001/*
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
13class GrContext;
14class GrGpu;
Brian Salomon653f42f2018-07-10 10:07:31 -040015class GrResourceProvider;
bsalomon@google.comded4f4b2012-06-28 18:48:06 +000016
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
bsalomon706f08f2015-05-22 07:35:58 -070024 static GrPathRenderer* Create(GrResourceProvider*, const GrCaps&);
bsalomon@google.comded4f4b2012-06-28 18:48:06 +000025
bsalomon@google.comded4f4b2012-06-28 18:48:06 +000026
bsalomon0aff2fa2015-07-31 06:48:27 -070027private:
bsalomon8acedde2016-06-24 10:42:16 -070028 StencilSupport onGetStencilSupport(const GrShape&) const override {
robertphillipse7d4b2f2015-08-13 07:57:10 -070029 return GrPathRenderer::kStencilOnly_StencilSupport;
30 }
bsalomon@google.com45a15f52012-12-10 19:10:17 +000031
Chris Dalton5ed44232017-09-07 13:22:46 -060032 CanDrawPath onCanDrawPath(const CanDrawPathArgs&) const override;
bsalomon@google.comded4f4b2012-06-28 18:48:06 +000033
bsalomon0aff2fa2015-07-31 06:48:27 -070034 bool onDrawPath(const DrawPathArgs&) override;
bsalomon@google.com45a15f52012-12-10 19:10:17 +000035
bsalomon0aff2fa2015-07-31 06:48:27 -070036 void onStencilPath(const StencilPathArgs&) override;
37
bsalomon706f08f2015-05-22 07:35:58 -070038 GrStencilAndCoverPathRenderer(GrResourceProvider*);
bsalomon@google.comded4f4b2012-06-28 18:48:06 +000039
bsalomon706f08f2015-05-22 07:35:58 -070040 GrResourceProvider* fResourceProvider;
bsalomon@google.comded4f4b2012-06-28 18:48:06 +000041
42 typedef GrPathRenderer INHERITED;
43};
44
45#endif