OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef GrAARectRenderer_DEFINED | 8 #ifndef GrAARectRenderer_DEFINED |
9 #define GrAARectRenderer_DEFINED | 9 #define GrAARectRenderer_DEFINED |
10 | 10 |
(...skipping 27 matching lines...) Expand all Loading... |
38 ~GrAARectRenderer() { | 38 ~GrAARectRenderer() { |
39 this->reset(); | 39 this->reset(); |
40 } | 40 } |
41 | 41 |
42 // TODO: potentialy fuse the fill & stroke methods and differentiate | 42 // TODO: potentialy fuse the fill & stroke methods and differentiate |
43 // between them by passing in stroke (==NULL means fill). | 43 // between them by passing in stroke (==NULL means fill). |
44 | 44 |
45 void fillAARect(GrDrawTarget* target, | 45 void fillAARect(GrDrawTarget* target, |
46 GrDrawState* ds, | 46 GrDrawState* ds, |
47 GrColor color, | 47 GrColor color, |
| 48 const SkMatrix& localMatrix, |
48 const SkRect& rect, | 49 const SkRect& rect, |
49 const SkMatrix& combinedMatrix, | 50 const SkMatrix& combinedMatrix, |
50 const SkRect& devRect) { | 51 const SkRect& devRect) { |
51 this->geometryFillAARect(target, ds, color, rect, combinedMatrix, devRec
t); | 52 this->geometryFillAARect(target, ds, color, localMatrix, rect, combinedM
atrix, devRect); |
52 } | 53 } |
53 | 54 |
54 void strokeAARect(GrDrawTarget*, | 55 void strokeAARect(GrDrawTarget*, |
55 GrDrawState*, | 56 GrDrawState*, |
56 GrColor, | 57 GrColor, |
| 58 const SkMatrix& localMatrix, |
57 const SkRect& rect, | 59 const SkRect& rect, |
58 const SkMatrix& combinedMatrix, | 60 const SkMatrix& combinedMatrix, |
59 const SkRect& devRect, | 61 const SkRect& devRect, |
60 const SkStrokeRec& stroke); | 62 const SkStrokeRec& stroke); |
61 | 63 |
62 // First rect is outer; second rect is inner | 64 // First rect is outer; second rect is inner |
63 void fillAANestedRects(GrDrawTarget*, | 65 void fillAANestedRects(GrDrawTarget*, |
64 GrDrawState*, | 66 GrDrawState*, |
65 GrColor, | 67 GrColor, |
| 68 const SkMatrix& localMatrix, |
66 const SkRect rects[2], | 69 const SkRect rects[2], |
67 const SkMatrix& combinedMatrix); | 70 const SkMatrix& combinedMatrix); |
68 | 71 |
69 private: | 72 private: |
70 GrIndexBuffer* aaStrokeRectIndexBuffer(bool miterStroke); | 73 GrIndexBuffer* aaStrokeRectIndexBuffer(bool miterStroke); |
71 | 74 |
72 void geometryFillAARect(GrDrawTarget*, | 75 void geometryFillAARect(GrDrawTarget*, |
73 GrDrawState*, | 76 GrDrawState*, |
74 GrColor, | 77 GrColor, |
| 78 const SkMatrix& localMatrix, |
75 const SkRect& rect, | 79 const SkRect& rect, |
76 const SkMatrix& combinedMatrix, | 80 const SkMatrix& combinedMatrix, |
77 const SkRect& devRect); | 81 const SkRect& devRect); |
78 | 82 |
79 void geometryStrokeAARect(GrDrawTarget*, | 83 void geometryStrokeAARect(GrDrawTarget*, |
80 GrDrawState*, | 84 GrDrawState*, |
81 GrColor, | 85 GrColor, |
| 86 const SkMatrix& localMatrix, |
82 const SkRect& devOutside, | 87 const SkRect& devOutside, |
83 const SkRect& devOutsideAssist, | 88 const SkRect& devOutsideAssist, |
84 const SkRect& devInside, | 89 const SkRect& devInside, |
85 bool miterStroke); | 90 bool miterStroke); |
86 | 91 |
87 GrGpu* fGpu; | 92 GrGpu* fGpu; |
88 GrIndexBuffer* fAAFillRectIndexBuffer; | 93 GrIndexBuffer* fAAFillRectIndexBuffer; |
89 GrIndexBuffer* fAAMiterStrokeRectIndexBuffer; | 94 GrIndexBuffer* fAAMiterStrokeRectIndexBuffer; |
90 GrIndexBuffer* fAABevelStrokeRectIndexBuffer; | 95 GrIndexBuffer* fAABevelStrokeRectIndexBuffer; |
91 | 96 |
92 typedef SkRefCnt INHERITED; | 97 typedef SkRefCnt INHERITED; |
93 }; | 98 }; |
94 | 99 |
95 #endif // GrAARectRenderer_DEFINED | 100 #endif // GrAARectRenderer_DEFINED |
OLD | NEW |