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 GrDrawTarget*, | 20 virtual bool canDrawPath(const GrDrawTarget*, |
21 const GrDrawState*, | 21 const GrDrawState*, |
| 22 const SkMatrix& viewMatrix, |
22 const SkPath&, | 23 const SkPath&, |
23 const SkStrokeRec&, | 24 const SkStrokeRec&, |
24 bool antiAlias) const SK_OVERRIDE; | 25 bool antiAlias) const SK_OVERRIDE; |
25 | 26 |
26 typedef SkTArray<SkPoint, true> PtArray; | 27 typedef SkTArray<SkPoint, true> PtArray; |
27 typedef SkTArray<int, true> IntArray; | 28 typedef SkTArray<int, true> IntArray; |
28 typedef SkTArray<float, true> FloatArray; | 29 typedef SkTArray<float, true> FloatArray; |
29 | 30 |
30 protected: | 31 protected: |
31 virtual bool onDrawPath(GrDrawTarget*, | 32 virtual bool onDrawPath(GrDrawTarget*, |
32 GrDrawState*, | 33 GrDrawState*, |
33 GrColor, | 34 GrColor, |
| 35 const SkMatrix& viewMatrix, |
34 const SkPath&, | 36 const SkPath&, |
35 const SkStrokeRec&, | 37 const SkStrokeRec&, |
36 bool antiAlias) SK_OVERRIDE; | 38 bool antiAlias) SK_OVERRIDE; |
37 | 39 |
38 private: | 40 private: |
39 GrAAHairLinePathRenderer(const GrContext* context, | 41 GrAAHairLinePathRenderer(const GrContext* context, |
40 const GrIndexBuffer* fLinesIndexBuffer, | 42 const GrIndexBuffer* fLinesIndexBuffer, |
41 const GrIndexBuffer* fQuadsIndexBuffer); | 43 const GrIndexBuffer* fQuadsIndexBuffer); |
42 | 44 |
43 bool createLineGeom(GrDrawTarget* target, | 45 bool createLineGeom(GrDrawTarget* target, |
44 GrDrawState*, | 46 GrDrawState*, |
| 47 const SkMatrix& viewMatrix, |
45 uint8_t coverage, | 48 uint8_t coverage, |
46 size_t vertexStride, | 49 size_t vertexStride, |
47 GrDrawTarget::AutoReleaseGeometry* arg, | 50 GrDrawTarget::AutoReleaseGeometry* arg, |
48 SkRect* devBounds, | 51 SkRect* devBounds, |
49 const SkPath& path, | 52 const SkPath& path, |
50 const PtArray& lines, | 53 const PtArray& lines, |
51 int lineCnt); | 54 int lineCnt); |
52 | 55 |
53 bool createBezierGeom(GrDrawTarget* target, | 56 bool createBezierGeom(GrDrawTarget* target, |
54 GrDrawState*, | 57 GrDrawState*, |
| 58 const SkMatrix& viewMatrix, |
55 GrDrawTarget::AutoReleaseGeometry* arg, | 59 GrDrawTarget::AutoReleaseGeometry* arg, |
56 SkRect* devBounds, | 60 SkRect* devBounds, |
57 const SkPath& path, | 61 const SkPath& path, |
58 const PtArray& quads, | 62 const PtArray& quads, |
59 int quadCnt, | 63 int quadCnt, |
60 const PtArray& conics, | 64 const PtArray& conics, |
61 int conicCnt, | 65 int conicCnt, |
62 const IntArray& qSubdivs, | 66 const IntArray& qSubdivs, |
63 const FloatArray& cWeights, | 67 const FloatArray& cWeights, |
64 size_t vertexStride); | 68 size_t vertexStride); |
65 | 69 |
66 const GrIndexBuffer* fLinesIndexBuffer; | 70 const GrIndexBuffer* fLinesIndexBuffer; |
67 const GrIndexBuffer* fQuadsIndexBuffer; | 71 const GrIndexBuffer* fQuadsIndexBuffer; |
68 | 72 |
69 typedef GrPathRenderer INHERITED; | 73 typedef GrPathRenderer INHERITED; |
70 }; | 74 }; |
71 | 75 |
72 | 76 |
73 #endif | 77 #endif |
OLD | NEW |