OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 GrRectBatchFactory_DEFINED | 8 #ifndef GrRectBatchFactory_DEFINED |
9 #define GrRectBatchFactory_DEFINED | 9 #define GrRectBatchFactory_DEFINED |
10 | 10 |
11 #include "GrAAFillRectBatch.h" | 11 #include "GrAAFillRectBatch.h" |
12 #include "GrColor.h" | 12 #include "GrColor.h" |
13 | 13 |
14 class GrBatch; | 14 class GrBatch; |
15 class SkMatrix; | 15 class SkMatrix; |
16 struct SkRect; | 16 struct SkRect; |
17 class SkStrokeRec; | 17 class SkStrokeRec; |
18 | 18 |
19 /* | 19 /* |
20 * A factory for returning batches which can draw rectangles. | 20 * A factory for returning batches which can draw rectangles. |
21 */ | 21 */ |
22 namespace GrRectBatchFactory { | 22 namespace GrRectBatchFactory { |
23 | 23 |
24 GrBatch* CreateFillBW(GrColor color, | 24 GrBatch* CreateFillBW(GrColor color, |
25 const SkMatrix& viewMatrix, | 25 const SkMatrix& viewMatrix, |
26 const SkRect& rect, | 26 const SkRect& rect, |
27 const SkRect* localRect, | 27 const SkRect* localRect, |
28 const SkMatrix* localMatrix); | 28 const SkMatrix* localMatrix); |
29 | 29 |
30 static GrBatch* CreateFillAA(GrColor color, | 30 inline GrBatch* CreateFillAA(GrColor color, |
31 const SkMatrix& viewMatrix, | 31 const SkMatrix& viewMatrix, |
32 const SkRect& rect, | 32 const SkRect& rect, |
33 const SkRect& devRect) { | 33 const SkRect& devRect) { |
34 return GrAAFillRectBatch::Create(color, viewMatrix, rect, devRect); | 34 return GrAAFillRectBatch::Create(color, viewMatrix, rect, devRect); |
35 } | 35 } |
36 | 36 |
| 37 inline GrBatch* CreateFillAA(GrColor color, |
| 38 const SkMatrix& viewMatrix, |
| 39 const SkMatrix& localMatrix, |
| 40 const SkRect& rect, |
| 41 const SkRect& devRect) { |
| 42 return GrAAFillRectBatch::Create(color, viewMatrix, localMatrix, rect, devRe
ct); |
| 43 } |
| 44 |
37 GrBatch* CreateStrokeBW(GrColor color, | 45 GrBatch* CreateStrokeBW(GrColor color, |
38 const SkMatrix& viewMatrix, | 46 const SkMatrix& viewMatrix, |
39 const SkRect& rect, | 47 const SkRect& rect, |
40 SkScalar strokeWidth, | 48 SkScalar strokeWidth, |
41 bool snapToPixelCenters); | 49 bool snapToPixelCenters); |
42 | 50 |
43 GrBatch* CreateStrokeAA(GrColor, | 51 GrBatch* CreateStrokeAA(GrColor, |
44 const SkMatrix& viewMatrix, | 52 const SkMatrix& viewMatrix, |
45 const SkRect& rect, | 53 const SkRect& rect, |
46 const SkRect& devRect, | 54 const SkRect& devRect, |
47 const SkStrokeRec& stroke); | 55 const SkStrokeRec& stroke); |
48 | 56 |
49 // First rect is outer; second rect is inner | 57 // First rect is outer; second rect is inner |
50 GrBatch* CreateFillNestedRectsAA(GrColor, | 58 GrBatch* CreateFillNestedRectsAA(GrColor, |
51 const SkMatrix& viewMatrix, | 59 const SkMatrix& viewMatrix, |
52 const SkRect rects[2]); | 60 const SkRect rects[2]); |
53 | 61 |
54 }; | 62 }; |
55 | 63 |
56 #endif | 64 #endif |
OLD | NEW |