| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #ifndef GrAAHairLinePathRenderer_DEFINED | 9 #ifndef GrAAHairLinePathRenderer_DEFINED |
| 10 #define GrAAHairLinePathRenderer_DEFINED | 10 #define GrAAHairLinePathRenderer_DEFINED |
| 11 | 11 |
| 12 #include "GrPathRenderer.h" | 12 #include "GrPathRenderer.h" |
| 13 | 13 |
| 14 class GrAAHairLinePathRenderer : public GrPathRenderer { | 14 class GrAAHairLinePathRenderer : public GrPathRenderer { |
| 15 public: | 15 public: |
| 16 virtual ~GrAAHairLinePathRenderer(); | 16 virtual ~GrAAHairLinePathRenderer(); |
| 17 | 17 |
| 18 static GrPathRenderer* Create(GrContext* context); | 18 static GrPathRenderer* Create(GrContext* context); |
| 19 | 19 |
| 20 virtual bool canDrawPath(const SkPath& path, | 20 virtual bool canDrawPath(const SkPath& path, |
| 21 const SkStrokeRec& stroke, | 21 const SkStrokeRec& stroke, |
| 22 const GrDrawTarget* target, | 22 const GrDrawTarget* target, |
| 23 bool antiAlias) const SK_OVERRIDE; | 23 bool antiAlias) const SK_OVERRIDE; |
| 24 | 24 |
| 25 typedef SkTArray<SkPoint, true> PtArray; |
| 26 typedef SkTArray<int, true> IntArray; |
| 27 typedef SkTArray<float, true> FloatArray; |
| 28 |
| 25 protected: | 29 protected: |
| 26 virtual bool onDrawPath(const SkPath& path, | 30 virtual bool onDrawPath(const SkPath& path, |
| 27 const SkStrokeRec& stroke, | 31 const SkStrokeRec& stroke, |
| 28 GrDrawTarget* target, | 32 GrDrawTarget* target, |
| 29 bool antiAlias) SK_OVERRIDE; | 33 bool antiAlias) SK_OVERRIDE; |
| 30 | 34 |
| 31 private: | 35 private: |
| 32 GrAAHairLinePathRenderer(const GrContext* context, | 36 GrAAHairLinePathRenderer(const GrContext* context, |
| 33 const GrIndexBuffer* fLinesIndexBuffer, | 37 const GrIndexBuffer* fLinesIndexBuffer, |
| 34 const GrIndexBuffer* fQuadsIndexBuffer); | 38 const GrIndexBuffer* fQuadsIndexBuffer); |
| 35 | 39 |
| 36 bool createGeom(const SkPath& path, | 40 bool createLineGeom(const SkPath& path, |
| 37 GrDrawTarget* target, | 41 GrDrawTarget* target, |
| 38 int* lineCnt, | 42 const PtArray& lines, |
| 39 int* quadCnt, | 43 int lineCnt, |
| 40 int* conicCnt, | 44 GrDrawTarget::AutoReleaseGeometry* arg, |
| 41 GrDrawTarget::AutoReleaseGeometry* arg, | 45 SkRect* devBounds); |
| 42 SkRect* devBounds ); | 46 |
| 47 bool createBezierGeom(const SkPath& path, |
| 48 GrDrawTarget* target, |
| 49 const PtArray& quads, |
| 50 int quadCnt, |
| 51 const PtArray& conics, |
| 52 int conicCnt, |
| 53 const IntArray& qSubdivs, |
| 54 const FloatArray& cWeights, |
| 55 GrDrawTarget::AutoReleaseGeometry* arg, |
| 56 SkRect* devBounds); |
| 43 | 57 |
| 44 const GrIndexBuffer* fLinesIndexBuffer; | 58 const GrIndexBuffer* fLinesIndexBuffer; |
| 45 const GrIndexBuffer* fQuadsIndexBuffer; | 59 const GrIndexBuffer* fQuadsIndexBuffer; |
| 46 | 60 |
| 47 typedef GrPathRenderer INHERITED; | 61 typedef GrPathRenderer INHERITED; |
| 48 }; | 62 }; |
| 49 | 63 |
| 50 | 64 |
| 51 #endif | 65 #endif |
| OLD | NEW |