Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(696)

Side by Side Diff: src/gpu/batches/GrAALinearizingConvexPathRenderer.cpp

Issue 1522973002: Fix for GrAALinearizingConvexPathRenderer incorrectly drawing non-convex paths (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/core/SkPathPriv.h ('k') | tests/IsClosedSingleContourTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/core/SkPathPriv.h ('k') | tests/IsClosedSingleContourTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698