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

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/skia/trunk/src/gpu/GrStencilAndCoverPathRenderer.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,55 @@
     1.4 +
     1.5 +/*
     1.6 + * Copyright 2012 Google Inc.
     1.7 + *
     1.8 + * Use of this source code is governed by a BSD-style license that can be
     1.9 + * found in the LICENSE file.
    1.10 + */
    1.11 +
    1.12 +#ifndef GrBuiltInPathRenderer_DEFINED
    1.13 +#define GrBuiltInPathRenderer_DEFINED
    1.14 +
    1.15 +#include "GrPathRenderer.h"
    1.16 +
    1.17 +class GrContext;
    1.18 +class GrGpu;
    1.19 +
    1.20 +/**
    1.21 + * Uses GrGpu::stencilPath followed by a cover rectangle. This subclass doesn't apply AA; it relies
    1.22 + * on the target having MSAA if AA is desired.
    1.23 + */
    1.24 +class GrStencilAndCoverPathRenderer : public GrPathRenderer {
    1.25 +public:
    1.26 +
    1.27 +    static GrPathRenderer* Create(GrContext*);
    1.28 +
    1.29 +    virtual ~GrStencilAndCoverPathRenderer();
    1.30 +
    1.31 +    virtual bool canDrawPath(const SkPath&,
    1.32 +                             const SkStrokeRec&,
    1.33 +                             const GrDrawTarget*,
    1.34 +                             bool antiAlias) const SK_OVERRIDE;
    1.35 +
    1.36 +protected:
    1.37 +    virtual StencilSupport onGetStencilSupport(const SkPath&,
    1.38 +                                               const SkStrokeRec&,
    1.39 +                                               const GrDrawTarget*) const SK_OVERRIDE;
    1.40 +
    1.41 +    virtual bool onDrawPath(const SkPath&,
    1.42 +                            const SkStrokeRec&,
    1.43 +                            GrDrawTarget*,
    1.44 +                            bool antiAlias) SK_OVERRIDE;
    1.45 +
    1.46 +    virtual void onStencilPath(const SkPath&,
    1.47 +                               const SkStrokeRec&,
    1.48 +                               GrDrawTarget*) SK_OVERRIDE;
    1.49 +
    1.50 +private:
    1.51 +    GrStencilAndCoverPathRenderer(GrGpu*);
    1.52 +
    1.53 +    GrGpu* fGpu;
    1.54 +
    1.55 +    typedef GrPathRenderer INHERITED;
    1.56 +};
    1.57 +
    1.58 +#endif

mercurial