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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 } | 46 } |
47 if (!args.fPath->isConvex()) { | 47 if (!args.fPath->isConvex()) { |
48 return false; | 48 return false; |
49 } | 49 } |
50 if (args.fStroke->getStyle() == SkStrokeRec::kStroke_Style) { | 50 if (args.fStroke->getStyle() == SkStrokeRec::kStroke_Style) { |
51 if (!args.fViewMatrix->isSimilarity()) { | 51 if (!args.fViewMatrix->isSimilarity()) { |
52 return false; | 52 return false; |
53 } | 53 } |
54 SkScalar strokeWidth = args.fViewMatrix->getMaxScale() * args.fStroke->g
etWidth(); | 54 SkScalar strokeWidth = args.fViewMatrix->getMaxScale() * args.fStroke->g
etWidth(); |
55 return strokeWidth >= 1.0f && strokeWidth <= kMaxStrokeWidth && !args.fS
troke->isDashed() && | 55 return strokeWidth >= 1.0f && strokeWidth <= kMaxStrokeWidth && !args.fS
troke->isDashed() && |
56 SkPathPriv::LastVerbIsClose(*args.fPath) && | 56 SkPathPriv::IsClosedSingleContour(*args.fPath) && |
57 args.fStroke->getJoin() != SkPaint::Join::kRound_Join; | 57 args.fStroke->getJoin() != SkPaint::Join::kRound_Join; |
58 } | 58 } |
59 return args.fStroke->getStyle() == SkStrokeRec::kFill_Style; | 59 return args.fStroke->getStyle() == SkStrokeRec::kFill_Style; |
60 } | 60 } |
61 | 61 |
62 // extract the result vertices and indices from the GrAAConvexTessellator | 62 // extract the result vertices and indices from the GrAAConvexTessellator |
63 static void extract_verts(const GrAAConvexTessellator& tess, | 63 static void extract_verts(const GrAAConvexTessellator& tess, |
64 void* vertices, | 64 void* vertices, |
65 size_t vertexStride, | 65 size_t vertexStride, |
66 GrColor color, | 66 GrColor color, |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 DRAW_BATCH_TEST_DEFINE(AAFlatteningConvexPathBatch) { | 347 DRAW_BATCH_TEST_DEFINE(AAFlatteningConvexPathBatch) { |
348 AAFlatteningConvexPathBatch::Geometry geometry; | 348 AAFlatteningConvexPathBatch::Geometry geometry; |
349 geometry.fColor = GrRandomColor(random); | 349 geometry.fColor = GrRandomColor(random); |
350 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random); | 350 geometry.fViewMatrix = GrTest::TestMatrixInvertible(random); |
351 geometry.fPath = GrTest::TestPathConvex(random); | 351 geometry.fPath = GrTest::TestPathConvex(random); |
352 | 352 |
353 return AAFlatteningConvexPathBatch::Create(geometry); | 353 return AAFlatteningConvexPathBatch::Create(geometry); |
354 } | 354 } |
355 | 355 |
356 #endif | 356 #endif |
OLD | NEW |