gfx/skia/trunk/src/gpu/GrDefaultPathRenderer.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/skia/trunk/src/gpu/GrDefaultPathRenderer.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,62 @@
     1.4 +/*
     1.5 + * Copyright 2011 Google Inc.
     1.6 + *
     1.7 + * Use of this source code is governed by a BSD-style license that can be
     1.8 + * found in the LICENSE file.
     1.9 + */
    1.10 +
    1.11 +#ifndef GrDefaultPathRenderer_DEFINED
    1.12 +#define GrDefaultPathRenderer_DEFINED
    1.13 +
    1.14 +#include "GrPathRenderer.h"
    1.15 +#include "SkTemplates.h"
    1.16 +
    1.17 +/**
    1.18 + *  Subclass that renders the path using the stencil buffer to resolve fill rules
    1.19 + * (e.g. winding, even-odd)
    1.20 + */
    1.21 +class SK_API GrDefaultPathRenderer : public GrPathRenderer {
    1.22 +public:
    1.23 +    GrDefaultPathRenderer(bool separateStencilSupport, bool stencilWrapOpsSupport);
    1.24 +
    1.25 +    virtual bool canDrawPath(const SkPath&,
    1.26 +                             const SkStrokeRec&,
    1.27 +                             const GrDrawTarget*,
    1.28 +                             bool antiAlias) const SK_OVERRIDE;
    1.29 +
    1.30 +private:
    1.31 +
    1.32 +    virtual StencilSupport onGetStencilSupport(const SkPath&,
    1.33 +                                               const SkStrokeRec&,
    1.34 +                                               const GrDrawTarget*) const SK_OVERRIDE;
    1.35 +
    1.36 +    virtual bool onDrawPath(const SkPath&,
    1.37 +                            const SkStrokeRec&,
    1.38 +                            GrDrawTarget*,
    1.39 +                            bool antiAlias) SK_OVERRIDE;
    1.40 +
    1.41 +    virtual void onStencilPath(const SkPath&,
    1.42 +                               const SkStrokeRec&,
    1.43 +                               GrDrawTarget*) SK_OVERRIDE;
    1.44 +
    1.45 +    bool internalDrawPath(const SkPath&,
    1.46 +                          const SkStrokeRec&,
    1.47 +                          GrDrawTarget*,
    1.48 +                          bool stencilOnly);
    1.49 +
    1.50 +    bool createGeom(const SkPath&,
    1.51 +                    const SkStrokeRec&,
    1.52 +                    SkScalar srcSpaceTol,
    1.53 +                    GrDrawTarget*,
    1.54 +                    GrPrimitiveType*,
    1.55 +                    int* vertexCnt,
    1.56 +                    int* indexCnt,
    1.57 +                    GrDrawTarget::AutoReleaseGeometry*);
    1.58 +
    1.59 +    bool    fSeparateStencil;
    1.60 +    bool    fStencilWrapOps;
    1.61 +
    1.62 +    typedef GrPathRenderer INHERITED;
    1.63 +};
    1.64 +
    1.65 +#endif

mercurial