blob: 2c1545ff700dfc3273f40976ee56e430fd1d20f4 [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
11#include "GrPathRenderer.h"
12#include "SkTemplates.h"
13
14/**
bsalomon@google.com45a15f52012-12-10 19:10:17 +000015 * Subclass that renders the path using the stencil buffer to resolve fill rules
16 * (e.g. winding, even-odd)
bsalomon@google.com30085192011-08-19 15:42:31 +000017 */
commit-bot@chromium.orgd28063e2013-08-20 12:23:06 +000018class SK_API GrDefaultPathRenderer : public GrPathRenderer {
bsalomon@google.com30085192011-08-19 15:42:31 +000019public:
bsalomon@google.com45a15f52012-12-10 19:10:17 +000020 GrDefaultPathRenderer(bool separateStencilSupport, bool stencilWrapOpsSupport);
bsalomon@google.com30085192011-08-19 15:42:31 +000021
bsalomon@google.com30085192011-08-19 15:42:31 +000022private:
23
joshualitt9853cce2014-11-17 14:22:48 -080024 virtual StencilSupport onGetStencilSupport(const GrDrawTarget*,
egdaniel8dd688b2015-01-22 10:16:09 -080025 const GrPipelineBuilder*,
joshualitt9853cce2014-11-17 14:22:48 -080026 const SkPath&,
kkinnunen18996512015-04-26 23:18:49 -070027 const GrStrokeInfo&) const override;
bsalomon@google.com45a15f52012-12-10 19:10:17 +000028
bsalomon0aff2fa2015-07-31 06:48:27 -070029 bool onCanDrawPath(const CanDrawPathArgs&) const override;
bsalomon@google.com30085192011-08-19 15:42:31 +000030
bsalomon0aff2fa2015-07-31 06:48:27 -070031 bool onDrawPath(const DrawPathArgs&) override;
32
33 void onStencilPath(const StencilPathArgs&) override;
bsalomon@google.com45a15f52012-12-10 19:10:17 +000034
joshualitt9853cce2014-11-17 14:22:48 -080035 bool internalDrawPath(GrDrawTarget*,
egdaniel8dd688b2015-01-22 10:16:09 -080036 GrPipelineBuilder*,
joshualitt2e3b3e32014-12-09 13:31:14 -080037 GrColor,
joshualitt8059eb92014-12-29 15:10:07 -080038 const SkMatrix& viewMatrix,
joshualitt9853cce2014-11-17 14:22:48 -080039 const SkPath&,
kkinnunen18996512015-04-26 23:18:49 -070040 const GrStrokeInfo&,
bsalomon@google.comc2099d22012-03-02 21:26:50 +000041 bool stencilOnly);
42
bsalomon@google.com30085192011-08-19 15:42:31 +000043 bool fSeparateStencil;
44 bool fStencilWrapOps;
45
bsalomon@google.com30085192011-08-19 15:42:31 +000046 typedef GrPathRenderer INHERITED;
47};
48
49#endif