1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/skia/trunk/src/gpu/GrAAHairLinePathRenderer.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,65 @@ 1.4 + 1.5 +/* 1.6 + * Copyright 2011 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 GrAAHairLinePathRenderer_DEFINED 1.13 +#define GrAAHairLinePathRenderer_DEFINED 1.14 + 1.15 +#include "GrPathRenderer.h" 1.16 + 1.17 +class GrAAHairLinePathRenderer : public GrPathRenderer { 1.18 +public: 1.19 + virtual ~GrAAHairLinePathRenderer(); 1.20 + 1.21 + static GrPathRenderer* Create(GrContext* context); 1.22 + 1.23 + virtual bool canDrawPath(const SkPath& path, 1.24 + const SkStrokeRec& stroke, 1.25 + const GrDrawTarget* target, 1.26 + bool antiAlias) const SK_OVERRIDE; 1.27 + 1.28 + typedef SkTArray<SkPoint, true> PtArray; 1.29 + typedef SkTArray<int, true> IntArray; 1.30 + typedef SkTArray<float, true> FloatArray; 1.31 + 1.32 +protected: 1.33 + virtual bool onDrawPath(const SkPath& path, 1.34 + const SkStrokeRec& stroke, 1.35 + GrDrawTarget* target, 1.36 + bool antiAlias) SK_OVERRIDE; 1.37 + 1.38 +private: 1.39 + GrAAHairLinePathRenderer(const GrContext* context, 1.40 + const GrIndexBuffer* fLinesIndexBuffer, 1.41 + const GrIndexBuffer* fQuadsIndexBuffer); 1.42 + 1.43 + bool createLineGeom(const SkPath& path, 1.44 + GrDrawTarget* target, 1.45 + const PtArray& lines, 1.46 + int lineCnt, 1.47 + GrDrawTarget::AutoReleaseGeometry* arg, 1.48 + SkRect* devBounds); 1.49 + 1.50 + bool createBezierGeom(const SkPath& path, 1.51 + GrDrawTarget* target, 1.52 + const PtArray& quads, 1.53 + int quadCnt, 1.54 + const PtArray& conics, 1.55 + int conicCnt, 1.56 + const IntArray& qSubdivs, 1.57 + const FloatArray& cWeights, 1.58 + GrDrawTarget::AutoReleaseGeometry* arg, 1.59 + SkRect* devBounds); 1.60 + 1.61 + const GrIndexBuffer* fLinesIndexBuffer; 1.62 + const GrIndexBuffer* fQuadsIndexBuffer; 1.63 + 1.64 + typedef GrPathRenderer INHERITED; 1.65 +}; 1.66 + 1.67 + 1.68 +#endif