blob: e7274d60b26bb1138ae3b2ff9507ef12c324e071 [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 Ludwig2686d692020-04-17 20:21:37 +000026 StencilSupport onGetStencilSupport(const GrStyledShape&) 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 Salomoneebe7352020-12-09 16:37:04 -050034 bool internalDrawPath(GrSurfaceDrawContext*,
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&,
Michael Ludwig7c12e282020-05-29 09:54:07 -040038 const GrClip*,
joshualitt8059eb92014-12-29 15:10:07 -080039 const SkMatrix& viewMatrix,
Michael Ludwig2686d692020-04-17 20:21:37 +000040 const GrStyledShape&,
bsalomon@google.comc2099d22012-03-02 21:26:50 +000041 bool stencilOnly);
42
John Stiles7571f9e2020-09-02 22:42:33 -040043 using INHERITED = GrPathRenderer;
bsalomon@google.com30085192011-08-19 15:42:31 +000044};
45
46#endif