13008519e9f977cd60194841d558a4f45c28e9833bsalomon@google.com/*
23008519e9f977cd60194841d558a4f45c28e9833bsalomon@google.com * Copyright 2011 Google Inc.
33008519e9f977cd60194841d558a4f45c28e9833bsalomon@google.com *
43008519e9f977cd60194841d558a4f45c28e9833bsalomon@google.com * Use of this source code is governed by a BSD-style license that can be
53008519e9f977cd60194841d558a4f45c28e9833bsalomon@google.com * found in the LICENSE file.
63008519e9f977cd60194841d558a4f45c28e9833bsalomon@google.com */
73008519e9f977cd60194841d558a4f45c28e9833bsalomon@google.com
83008519e9f977cd60194841d558a4f45c28e9833bsalomon@google.com#ifndef GrDefaultPathRenderer_DEFINED
93008519e9f977cd60194841d558a4f45c28e9833bsalomon@google.com#define GrDefaultPathRenderer_DEFINED
103008519e9f977cd60194841d558a4f45c28e9833bsalomon@google.com
113008519e9f977cd60194841d558a4f45c28e9833bsalomon@google.com#include "GrPathRenderer.h"
123008519e9f977cd60194841d558a4f45c28e9833bsalomon@google.com#include "SkTemplates.h"
133008519e9f977cd60194841d558a4f45c28e9833bsalomon@google.com
143008519e9f977cd60194841d558a4f45c28e9833bsalomon@google.com/**
1545a15f551b5b3c6c747d8eaf6466b7d3b76a8faebsalomon@google.com *  Subclass that renders the path using the stencil buffer to resolve fill rules
1645a15f551b5b3c6c747d8eaf6466b7d3b76a8faebsalomon@google.com * (e.g. winding, even-odd)
173008519e9f977cd60194841d558a4f45c28e9833bsalomon@google.com */
18d28063e4916b489f572eb8358efcb7305f88c2fdcommit-bot@chromium.orgclass SK_API GrDefaultPathRenderer : public GrPathRenderer {
193008519e9f977cd60194841d558a4f45c28e9833bsalomon@google.compublic:
2045a15f551b5b3c6c747d8eaf6466b7d3b76a8faebsalomon@google.com    GrDefaultPathRenderer(bool separateStencilSupport, bool stencilWrapOpsSupport);
213008519e9f977cd60194841d558a4f45c28e9833bsalomon@google.com
229853ccef19c200be93a6211f32589fa82a53067cjoshualitt    virtual bool canDrawPath(const GrDrawTarget*,
238dd688b7569df569a672a8a67b2db86a9d376cfcegdaniel                             const GrPipelineBuilder*,
248059eb9f6e24ed609393fbda4ad71edea03ac258joshualitt                             const SkMatrix& viewMatrix,
259853ccef19c200be93a6211f32589fa82a53067cjoshualitt                             const SkPath&,
261899651ffc459f5462aa989cd6d08507947b67e4kkinnunen                             const GrStrokeInfo&,
2736352bf5e38f45a70ee4f4fc132a38048d38206dmtklein                             bool antiAlias) const override;
283008519e9f977cd60194841d558a4f45c28e9833bsalomon@google.com
293008519e9f977cd60194841d558a4f45c28e9833bsalomon@google.comprivate:
303008519e9f977cd60194841d558a4f45c28e9833bsalomon@google.com
319853ccef19c200be93a6211f32589fa82a53067cjoshualitt    virtual StencilSupport onGetStencilSupport(const GrDrawTarget*,
328dd688b7569df569a672a8a67b2db86a9d376cfcegdaniel                                               const GrPipelineBuilder*,
339853ccef19c200be93a6211f32589fa82a53067cjoshualitt                                               const SkPath&,
341899651ffc459f5462aa989cd6d08507947b67e4kkinnunen                                               const GrStrokeInfo&) const override;
3545a15f551b5b3c6c747d8eaf6466b7d3b76a8faebsalomon@google.com
369853ccef19c200be93a6211f32589fa82a53067cjoshualitt    virtual bool onDrawPath(GrDrawTarget*,
378dd688b7569df569a672a8a67b2db86a9d376cfcegdaniel                            GrPipelineBuilder*,
382e3b3e369d79e78f7635d4c20e83a47ab571bdf2joshualitt                            GrColor,
398059eb9f6e24ed609393fbda4ad71edea03ac258joshualitt                            const SkMatrix& viewMatrix,
409853ccef19c200be93a6211f32589fa82a53067cjoshualitt                            const SkPath&,
411899651ffc459f5462aa989cd6d08507947b67e4kkinnunen                            const GrStrokeInfo&,
4236352bf5e38f45a70ee4f4fc132a38048d38206dmtklein                            bool antiAlias) override;
433008519e9f977cd60194841d558a4f45c28e9833bsalomon@google.com
449853ccef19c200be93a6211f32589fa82a53067cjoshualitt    virtual void onStencilPath(GrDrawTarget*,
458dd688b7569df569a672a8a67b2db86a9d376cfcegdaniel                               GrPipelineBuilder*,
468059eb9f6e24ed609393fbda4ad71edea03ac258joshualitt                               const SkMatrix& viewMatrix,
479853ccef19c200be93a6211f32589fa82a53067cjoshualitt                               const SkPath&,
481899651ffc459f5462aa989cd6d08507947b67e4kkinnunen                               const GrStrokeInfo&) override;
4945a15f551b5b3c6c747d8eaf6466b7d3b76a8faebsalomon@google.com
509853ccef19c200be93a6211f32589fa82a53067cjoshualitt    bool internalDrawPath(GrDrawTarget*,
518dd688b7569df569a672a8a67b2db86a9d376cfcegdaniel                          GrPipelineBuilder*,
522e3b3e369d79e78f7635d4c20e83a47ab571bdf2joshualitt                          GrColor,
538059eb9f6e24ed609393fbda4ad71edea03ac258joshualitt                          const SkMatrix& viewMatrix,
549853ccef19c200be93a6211f32589fa82a53067cjoshualitt                          const SkPath&,
551899651ffc459f5462aa989cd6d08507947b67e4kkinnunen                          const GrStrokeInfo&,
56c2099d2707abcc94e139627399aed4b8894b69bbbsalomon@google.com                          bool stencilOnly);
57c2099d2707abcc94e139627399aed4b8894b69bbbsalomon@google.com
583008519e9f977cd60194841d558a4f45c28e9833bsalomon@google.com    bool    fSeparateStencil;
593008519e9f977cd60194841d558a4f45c28e9833bsalomon@google.com    bool    fStencilWrapOps;
603008519e9f977cd60194841d558a4f45c28e9833bsalomon@google.com
613008519e9f977cd60194841d558a4f45c28e9833bsalomon@google.com    typedef GrPathRenderer INHERITED;
623008519e9f977cd60194841d558a4f45c28e9833bsalomon@google.com};
633008519e9f977cd60194841d558a4f45c28e9833bsalomon@google.com
643008519e9f977cd60194841d558a4f45c28e9833bsalomon@google.com#endif
65