1/*
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
11#include "include/core/SkTypes.h"
12#include "src/gpu/GrPathRenderer.h"
13#include "src/gpu/ops/GrPathStencilSettings.h"
14
15/**
16 * Subclass that renders the path using the stencil buffer to resolve fill rules
17 * (e.g. winding, even-odd)
18 */
19class GrDefaultPathRenderer : public GrPathRenderer {
20public:
21 GrDefaultPathRenderer();
22
23 const char* name() const final { return "Default"; }
24
25private:
26 StencilSupport onGetStencilSupport(const GrStyledShape&) const override;
27
28 CanDrawPath onCanDrawPath(const CanDrawPathArgs&) const override;
29
30 bool onDrawPath(const DrawPathArgs&) override;
31
32 void onStencilPath(const StencilPathArgs&) override;
33
34 bool internalDrawPath(GrRenderTargetContext*,
35 GrPaint&&,
36 GrAAType,
37 const GrUserStencilSettings&,
38 const GrClip*,
39 const SkMatrix& viewMatrix,
40 const GrStyledShape&,
41 bool stencilOnly);
42
43 typedef GrPathRenderer INHERITED;
44};
45
46#endif
47