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 "GrAALinearizingConvexPathRenderer.h" | 9 #include "GrAALinearizingConvexPathRenderer.h" |
10 | 10 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 if (!args.fAntiAlias) { | 43 if (!args.fAntiAlias) { |
44 return false; | 44 return false; |
45 } | 45 } |
46 if (args.fPath->isInverseFillType()) { | 46 if (args.fPath->isInverseFillType()) { |
47 return false; | 47 return false; |
48 } | 48 } |
49 if (!args.fPath->isConvex()) { | 49 if (!args.fPath->isConvex()) { |
50 return false; | 50 return false; |
51 } | 51 } |
52 if (args.fStroke->getStyle() == SkStrokeRec::kStroke_Style) { | 52 if (args.fStroke->getStyle() == SkStrokeRec::kStroke_Style) { |
53 return args.fViewMatrix->isSimilarity() && args.fStroke->getWidth() >= 1
.0f && | 53 if (!args.fViewMatrix->isSimilarity()) { |
54 args.fStroke->getWidth() <= kMaxStrokeWidth && !args.fStroke->is
Dashed() && | 54 return false; |
| 55 } |
| 56 SkScalar strokeWidth = args.fViewMatrix->getMaxScale() * args.fStroke->g
etWidth(); |
| 57 return strokeWidth >= 1.0f && strokeWidth <= kMaxStrokeWidth && !args.fS
troke->isDashed() && |
55 SkPathPriv::LastVerbIsClose(*args.fPath) && | 58 SkPathPriv::LastVerbIsClose(*args.fPath) && |
56 args.fStroke->getJoin() != SkPaint::Join::kRound_Join; | 59 args.fStroke->getJoin() != SkPaint::Join::kRound_Join; |
57 } | 60 } |
58 return args.fStroke->getStyle() == SkStrokeRec::kFill_Style; | 61 return args.fStroke->getStyle() == SkStrokeRec::kFill_Style; |
59 } | 62 } |
60 | 63 |
61 // extract the result vertices and indices from the GrAAConvexTessellator | 64 // extract the result vertices and indices from the GrAAConvexTessellator |
62 static void extract_verts(const GrAAConvexTessellator& tess, | 65 static void extract_verts(const GrAAConvexTessellator& tess, |
63 void* vertices, | 66 void* vertices, |
64 size_t vertexStride, | 67 size_t vertexStride, |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 DRAW_BATCH_TEST_DEFINE(AAFlatteningConvexPathBatch) { | 336 DRAW_BATCH_TEST_DEFINE(AAFlatteningConvexPathBatch) { |
334 AAFlatteningConvexPathBatch::Geometry geometry; | 337 AAFlatteningConvexPathBatch::Geometry geometry; |
335 geometry.fColor = GrRandomColor(random); | 338 geometry.fColor = GrRandomColor(random); |
336 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random); | 339 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random); |
337 geometry.fPath = GrTest::TestPathConvex(random); | 340 geometry.fPath = GrTest::TestPathConvex(random); |
338 | 341 |
339 return AAFlatteningConvexPathBatch::Create(geometry); | 342 return AAFlatteningConvexPathBatch::Create(geometry); |
340 } | 343 } |
341 | 344 |
342 #endif | 345 #endif |
OLD | NEW |