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 #include "GrRectBatchFactory.h" | 8 #include "GrRectBatchFactory.h" |
9 | 9 |
10 #include "GrAAFillRectBatch.h" | 10 #include "GrAAFillRectBatch.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 if (localMatrix) { | 52 if (localMatrix) { |
53 geometry.fHasLocalMatrix = true; | 53 geometry.fHasLocalMatrix = true; |
54 geometry.fLocalMatrix = *localMatrix; | 54 geometry.fLocalMatrix = *localMatrix; |
55 } else { | 55 } else { |
56 geometry.fHasLocalMatrix = false; | 56 geometry.fHasLocalMatrix = false; |
57 } | 57 } |
58 | 58 |
59 return GrRectBatch::Create(geometry); | 59 return GrRectBatch::Create(geometry); |
60 } | 60 } |
61 | 61 |
62 GrBatch* CreateFillAA(GrColor color, | |
63 const SkMatrix& viewMatrix, | |
64 const SkRect& rect, | |
65 const SkRect& devRect) { | |
66 GrAAFillRectBatch::Geometry geometry; | |
67 geometry.fRect = rect; | |
68 geometry.fViewMatrix = viewMatrix; | |
69 geometry.fDevRect = devRect; | |
70 geometry.fColor = color; | |
71 | |
72 return GrAAFillRectBatch::Create(geometry); | |
73 } | |
74 | |
75 GrBatch* CreateStrokeBW(GrColor color, | 62 GrBatch* CreateStrokeBW(GrColor color, |
76 const SkMatrix& viewMatrix, | 63 const SkMatrix& viewMatrix, |
77 const SkRect& rect, | 64 const SkRect& rect, |
78 SkScalar strokeWidth, | 65 SkScalar strokeWidth, |
79 bool snapToPixelCenters) { | 66 bool snapToPixelCenters) { |
80 GrStrokeRectBatch::Geometry geometry; | 67 GrStrokeRectBatch::Geometry geometry; |
81 geometry.fColor = color; | 68 geometry.fColor = color; |
82 geometry.fViewMatrix = viewMatrix; | 69 geometry.fViewMatrix = viewMatrix; |
83 geometry.fRect = rect; | 70 geometry.fRect = rect; |
84 geometry.fStrokeWidth = strokeWidth; | 71 geometry.fStrokeWidth = strokeWidth; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 viewMatrix.mapRect(&devInside, rects[1]); | 142 viewMatrix.mapRect(&devInside, rects[1]); |
156 | 143 |
157 if (devInside.isEmpty()) { | 144 if (devInside.isEmpty()) { |
158 return CreateFillAA(color, viewMatrix, devOutside, devOutside); | 145 return CreateFillAA(color, viewMatrix, devOutside, devOutside); |
159 } | 146 } |
160 | 147 |
161 return create_stroke_aa_batch(color, viewMatrix, devOutside, devOutside, dev
Inside, true); | 148 return create_stroke_aa_batch(color, viewMatrix, devOutside, devOutside, dev
Inside, true); |
162 } | 149 } |
163 | 150 |
164 }; | 151 }; |
OLD | NEW |