michael@0: 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 GrAAHairLinePathRenderer_DEFINED michael@0: #define GrAAHairLinePathRenderer_DEFINED michael@0: michael@0: #include "GrPathRenderer.h" michael@0: michael@0: class GrAAHairLinePathRenderer : public GrPathRenderer { michael@0: public: michael@0: virtual ~GrAAHairLinePathRenderer(); michael@0: michael@0: static GrPathRenderer* Create(GrContext* context); michael@0: michael@0: virtual bool canDrawPath(const SkPath& path, michael@0: const SkStrokeRec& stroke, michael@0: const GrDrawTarget* target, michael@0: bool antiAlias) const SK_OVERRIDE; michael@0: michael@0: typedef SkTArray PtArray; michael@0: typedef SkTArray IntArray; michael@0: typedef SkTArray FloatArray; michael@0: michael@0: protected: michael@0: virtual bool onDrawPath(const SkPath& path, michael@0: const SkStrokeRec& stroke, michael@0: GrDrawTarget* target, michael@0: bool antiAlias) SK_OVERRIDE; michael@0: michael@0: private: michael@0: GrAAHairLinePathRenderer(const GrContext* context, michael@0: const GrIndexBuffer* fLinesIndexBuffer, michael@0: const GrIndexBuffer* fQuadsIndexBuffer); michael@0: michael@0: bool createLineGeom(const SkPath& path, michael@0: GrDrawTarget* target, michael@0: const PtArray& lines, michael@0: int lineCnt, michael@0: GrDrawTarget::AutoReleaseGeometry* arg, michael@0: SkRect* devBounds); michael@0: michael@0: bool createBezierGeom(const SkPath& path, michael@0: GrDrawTarget* target, michael@0: const PtArray& quads, michael@0: int quadCnt, michael@0: const PtArray& conics, michael@0: int conicCnt, michael@0: const IntArray& qSubdivs, michael@0: const FloatArray& cWeights, michael@0: GrDrawTarget::AutoReleaseGeometry* arg, michael@0: SkRect* devBounds); michael@0: michael@0: const GrIndexBuffer* fLinesIndexBuffer; michael@0: const GrIndexBuffer* fQuadsIndexBuffer; michael@0: michael@0: typedef GrPathRenderer INHERITED; michael@0: }; michael@0: michael@0: michael@0: #endif