OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2015 Google Inc. | 3 * Copyright 2015 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 #include "GrAARectRenderer.h" | 9 #include "GrAARectRenderer.h" |
10 #include "GrAtlasTextContext.h" | 10 #include "GrAtlasTextContext.h" |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 SkScalarIsInt(r.fRight) && SkScalarIsInt(r.fBottom); | 206 SkScalarIsInt(r.fRight) && SkScalarIsInt(r.fBottom); |
207 } | 207 } |
208 | 208 |
209 static bool apply_aa_to_rect(GrDrawTarget* target, | 209 static bool apply_aa_to_rect(GrDrawTarget* target, |
210 GrPipelineBuilder* pipelineBuilder, | 210 GrPipelineBuilder* pipelineBuilder, |
211 SkRect* devBoundRect, | 211 SkRect* devBoundRect, |
212 const SkRect& rect, | 212 const SkRect& rect, |
213 SkScalar strokeWidth, | 213 SkScalar strokeWidth, |
214 const SkMatrix& combinedMatrix, | 214 const SkMatrix& combinedMatrix, |
215 GrColor color) { | 215 GrColor color) { |
216 if (pipelineBuilder->getRenderTarget()->isUnifiedMultisampled()) { | 216 if (pipelineBuilder->getRenderTarget()->isUnifiedMultisampled() || |
| 217 !combinedMatrix.preservesAxisAlignment()) { |
217 return false; | 218 return false; |
218 } | 219 } |
219 | 220 |
220 #ifdef SHADER_AA_FILL_RECT | |
221 if (strokeWidth >= 0) { | |
222 #endif | |
223 if (!combinedMatrix.preservesAxisAlignment()) { | |
224 return false; | |
225 } | |
226 | |
227 #ifdef SHADER_AA_FILL_RECT | |
228 } else { | |
229 if (!combinedMatrix.preservesRightAngles()) { | |
230 return false; | |
231 } | |
232 } | |
233 #endif | |
234 | |
235 combinedMatrix.mapRect(devBoundRect, rect); | 221 combinedMatrix.mapRect(devBoundRect, rect); |
236 if (!combinedMatrix.rectStaysRect()) { | 222 if (!combinedMatrix.rectStaysRect()) { |
237 return true; | 223 return true; |
238 } | 224 } |
239 | 225 |
240 if (strokeWidth < 0) { | 226 if (strokeWidth < 0) { |
241 return !is_irect(*devBoundRect); | 227 return !is_irect(*devBoundRect); |
242 } | 228 } |
243 | 229 |
244 return true; | 230 return true; |
(...skipping 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1334 return DrawVerticesBatch::Create(geometry, type, viewMatrix, | 1320 return DrawVerticesBatch::Create(geometry, type, viewMatrix, |
1335 positions.begin(), vertexCount, | 1321 positions.begin(), vertexCount, |
1336 indices.begin(), hasIndices ? vertexCount :
0, | 1322 indices.begin(), hasIndices ? vertexCount :
0, |
1337 colors.begin(), | 1323 colors.begin(), |
1338 texCoords.begin(), | 1324 texCoords.begin(), |
1339 bounds); | 1325 bounds); |
1340 } | 1326 } |
1341 | 1327 |
1342 #endif | 1328 #endif |
1343 | 1329 |
OLD | NEW |