michael@0: /* michael@0: * Copyright 2011 Google Inc. michael@0: * michael@0: * Use of this source code is governed by a BSD-style license that can be michael@0: * found in the LICENSE file. michael@0: */ michael@0: michael@0: #ifndef GrDefaultPathRenderer_DEFINED michael@0: #define GrDefaultPathRenderer_DEFINED michael@0: michael@0: #include "GrPathRenderer.h" michael@0: #include "SkTemplates.h" michael@0: michael@0: /** michael@0: * Subclass that renders the path using the stencil buffer to resolve fill rules michael@0: * (e.g. winding, even-odd) michael@0: */ michael@0: class SK_API GrDefaultPathRenderer : public GrPathRenderer { michael@0: public: michael@0: GrDefaultPathRenderer(bool separateStencilSupport, bool stencilWrapOpsSupport); michael@0: michael@0: virtual bool canDrawPath(const SkPath&, michael@0: const SkStrokeRec&, michael@0: const GrDrawTarget*, michael@0: bool antiAlias) const SK_OVERRIDE; michael@0: michael@0: private: michael@0: michael@0: virtual StencilSupport onGetStencilSupport(const SkPath&, michael@0: const SkStrokeRec&, michael@0: const GrDrawTarget*) const SK_OVERRIDE; michael@0: michael@0: virtual bool onDrawPath(const SkPath&, michael@0: const SkStrokeRec&, michael@0: GrDrawTarget*, michael@0: bool antiAlias) SK_OVERRIDE; michael@0: michael@0: virtual void onStencilPath(const SkPath&, michael@0: const SkStrokeRec&, michael@0: GrDrawTarget*) SK_OVERRIDE; michael@0: michael@0: bool internalDrawPath(const SkPath&, michael@0: const SkStrokeRec&, michael@0: GrDrawTarget*, michael@0: bool stencilOnly); michael@0: michael@0: bool createGeom(const SkPath&, michael@0: const SkStrokeRec&, michael@0: SkScalar srcSpaceTol, michael@0: GrDrawTarget*, michael@0: GrPrimitiveType*, michael@0: int* vertexCnt, michael@0: int* indexCnt, michael@0: GrDrawTarget::AutoReleaseGeometry*); michael@0: michael@0: bool fSeparateStencil; michael@0: bool fStencilWrapOps; michael@0: michael@0: typedef GrPathRenderer INHERITED; michael@0: }; michael@0: michael@0: #endif