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

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

Issue 1302503003: Fix transformed stroke width in GrAALinearizingConvexPathRenderer. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 months 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/gpu/GrAAConvexTessellator.cpp ('k') | no next file » | 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « src/gpu/GrAAConvexTessellator.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698