blob: bb8cdb0dd7724602ad608d17c5f8f113d5315b90 [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
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:
robertphillipse7d4b2f2015-08-13 07:57:10 -070028 StencilSupport onGetStencilSupport(const SkPath&, const GrStrokeInfo&) const override {
29 return GrPathRenderer::kStencilOnly_StencilSupport;
30 }
bsalomon@google.com45a15f52012-12-10 19:10:17 +000031
bsalomon0aff2fa2015-07-31 06:48:27 -070032 bool 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