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 SkMatrix& viewMatrix, |
49 const SkRect& rect, | 49 const SkRect& rect, |
50 const SkMatrix& combinedMatrix, | |
51 const SkRect& devRect) { | 50 const SkRect& devRect) { |
52 this->geometryFillAARect(target, ds, color, localMatrix, rect, combinedM
atrix, devRect); | 51 this->geometryFillAARect(target, ds, color, viewMatrix, rect, devRect); |
53 } | 52 } |
54 | 53 |
55 void strokeAARect(GrDrawTarget*, | 54 void strokeAARect(GrDrawTarget*, |
56 GrDrawState*, | 55 GrDrawState*, |
57 GrColor, | 56 GrColor, |
58 const SkMatrix& localMatrix, | 57 const SkMatrix& viewMatrix, |
59 const SkRect& rect, | 58 const SkRect& rect, |
60 const SkMatrix& combinedMatrix, | |
61 const SkRect& devRect, | 59 const SkRect& devRect, |
62 const SkStrokeRec& stroke); | 60 const SkStrokeRec& stroke); |
63 | 61 |
64 // First rect is outer; second rect is inner | 62 // First rect is outer; second rect is inner |
65 void fillAANestedRects(GrDrawTarget*, | 63 void fillAANestedRects(GrDrawTarget*, |
66 GrDrawState*, | 64 GrDrawState*, |
67 GrColor, | 65 GrColor, |
68 const SkMatrix& localMatrix, | 66 const SkMatrix& viewMatrix, |
69 const SkRect rects[2], | 67 const SkRect rects[2]); |
70 const SkMatrix& combinedMatrix); | |
71 | 68 |
72 private: | 69 private: |
73 GrIndexBuffer* aaStrokeRectIndexBuffer(bool miterStroke); | 70 GrIndexBuffer* aaStrokeRectIndexBuffer(bool miterStroke); |
74 | 71 |
75 void geometryFillAARect(GrDrawTarget*, | 72 void geometryFillAARect(GrDrawTarget*, |
76 GrDrawState*, | 73 GrDrawState*, |
77 GrColor, | 74 GrColor, |
78 const SkMatrix& localMatrix, | 75 const SkMatrix& viewMatrix, |
79 const SkRect& rect, | 76 const SkRect& rect, |
80 const SkMatrix& combinedMatrix, | |
81 const SkRect& devRect); | 77 const SkRect& devRect); |
82 | 78 |
83 void geometryStrokeAARect(GrDrawTarget*, | 79 void geometryStrokeAARect(GrDrawTarget*, |
84 GrDrawState*, | 80 GrDrawState*, |
85 GrColor, | 81 GrColor, |
86 const SkMatrix& localMatrix, | 82 const SkMatrix& viewMatrix, |
87 const SkRect& devOutside, | 83 const SkRect& devOutside, |
88 const SkRect& devOutsideAssist, | 84 const SkRect& devOutsideAssist, |
89 const SkRect& devInside, | 85 const SkRect& devInside, |
90 bool miterStroke); | 86 bool miterStroke); |
91 | 87 |
92 GrGpu* fGpu; | 88 GrGpu* fGpu; |
93 GrIndexBuffer* fAAFillRectIndexBuffer; | 89 GrIndexBuffer* fAAFillRectIndexBuffer; |
94 GrIndexBuffer* fAAMiterStrokeRectIndexBuffer; | 90 GrIndexBuffer* fAAMiterStrokeRectIndexBuffer; |
95 GrIndexBuffer* fAABevelStrokeRectIndexBuffer; | 91 GrIndexBuffer* fAABevelStrokeRectIndexBuffer; |
96 | 92 |
97 typedef SkRefCnt INHERITED; | 93 typedef SkRefCnt INHERITED; |
98 }; | 94 }; |
99 | 95 |
100 #endif // GrAARectRenderer_DEFINED | 96 #endif // GrAARectRenderer_DEFINED |
OLD | NEW |