1 2/* 3 * Copyright 2011 Google Inc. 4 * 5 * Use of this source code is governed by a BSD-style license that can be 6 * found in the LICENSE file. 7 */ 8 9#ifndef GrAAHairLinePathRenderer_DEFINED 10#define GrAAHairLinePathRenderer_DEFINED 11 12#include "GrPathRenderer.h" 13 14class GrAAHairLinePathRenderer : public GrPathRenderer { 15public: 16 virtual ~GrAAHairLinePathRenderer(); 17 18 static GrPathRenderer* Create(GrContext* context); 19 20 virtual bool canDrawPath(const SkPath& path, 21 const SkStrokeRec& stroke, 22 const GrDrawTarget* target, 23 bool antiAlias) const SK_OVERRIDE; 24 25protected: 26 virtual bool onDrawPath(const SkPath& path, 27 const SkStrokeRec& stroke, 28 GrDrawTarget* target, 29 bool antiAlias) SK_OVERRIDE; 30 31private: 32 33 GrAAHairLinePathRenderer(const GrContext* context, 34 const GrIndexBuffer* fLinesIndexBuffer, 35 const GrIndexBuffer* fQuadsIndexBuffer); 36 37 bool createGeom(const SkPath& path, 38 GrDrawTarget* target, 39 int* lineCnt, 40 int* quadCnt, 41 GrDrawTarget::AutoReleaseGeometry* arg); 42 43 const GrIndexBuffer* fLinesIndexBuffer; 44 const GrIndexBuffer* fQuadsIndexBuffer; 45 46 typedef GrPathRenderer INHERITED; 47}; 48 49 50#endif 51