blob: a42061c0cb8c487c24c210ea1b86d071ada4ca94 [file] [log] [blame]
bsalomon@google.com30085192011-08-19 15:42:31 +00001/*
2 * Copyright 2011 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 GrDefaultPathRenderer_DEFINED
9#define GrDefaultPathRenderer_DEFINED
10
Mike Kleinc0bd9f92019-04-23 12:05:21 -050011#include "include/core/SkTypes.h"
12#include "src/gpu/GrPathRenderer.h"
13#include "src/gpu/ops/GrPathStencilSettings.h"
bsalomon@google.com30085192011-08-19 15:42:31 +000014
15/**
bsalomon@google.com45a15f52012-12-10 19:10:17 +000016 * Subclass that renders the path using the stencil buffer to resolve fill rules
17 * (e.g. winding, even-odd)
bsalomon@google.com30085192011-08-19 15:42:31 +000018 */
Brian Salomon57f211b2019-08-21 15:21:09 -040019class GrDefaultPathRenderer : public GrPathRenderer {
bsalomon@google.com30085192011-08-19 15:42:31 +000020public:
Brian Salomon15b25092017-05-08 11:10:53 -040021 GrDefaultPathRenderer();
bsalomon@google.com30085192011-08-19 15:42:31 +000022
Robert Phillipsa6286052020-04-13 10:55:08 -040023 const char* name() const final { return "Default"; }
24
bsalomon@google.com30085192011-08-19 15:42:31 +000025private:
Michael Ludwig73b86c12020-04-17 18:48:22 +000026 StencilSupport onGetStencilSupport(const GrShape&) const override;
bsalomon@google.com45a15f52012-12-10 19:10:17 +000027
Chris Dalton5ed44232017-09-07 13:22:46 -060028 CanDrawPath onCanDrawPath(const CanDrawPathArgs&) const override;
bsalomon@google.com30085192011-08-19 15:42:31 +000029
bsalomon0aff2fa2015-07-31 06:48:27 -070030 bool onDrawPath(const DrawPathArgs&) override;
31
32 void onStencilPath(const StencilPathArgs&) override;
bsalomon@google.com45a15f52012-12-10 19:10:17 +000033
Brian Osman11052242016-10-27 14:47:55 -040034 bool internalDrawPath(GrRenderTargetContext*,
Brian Salomon82f44312017-01-11 13:42:54 -050035 GrPaint&&,
Brian Salomon0e8fc8b2016-12-09 15:10:07 -050036 GrAAType,
robertphillipsd2b6d642016-07-21 08:55:08 -070037 const GrUserStencilSettings&,
cdalton862cff32016-05-12 15:09:48 -070038 const GrClip&,
joshualitt8059eb92014-12-29 15:10:07 -080039 const SkMatrix& viewMatrix,
Michael Ludwig73b86c12020-04-17 18:48:22 +000040 const GrShape&,
bsalomon@google.comc2099d22012-03-02 21:26:50 +000041 bool stencilOnly);
42
bsalomon@google.com30085192011-08-19 15:42:31 +000043 typedef GrPathRenderer INHERITED;
44};
45
46#endif