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

Side by Side Diff: src/core/SkStroke.cpp

Issue 1228383002: compute convexity for very small paths (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix path documentation Created 5 years, 5 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/core/SkPath.cpp ('k') | tests/PathTest.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 * Copyright 2008 The Android Open Source Project 2 * Copyright 2008 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkStrokerPriv.h" 8 #include "SkStrokerPriv.h"
9 #include "SkGeometry.h" 9 #include "SkGeometry.h"
10 #include "SkPathPriv.h" 10 #include "SkPathPriv.h"
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 fSegmentCount = 0; 349 fSegmentCount = 0;
350 fFirstPt = fPrevPt = pt; 350 fFirstPt = fPrevPt = pt;
351 } 351 }
352 352
353 void SkPathStroker::line_to(const SkPoint& currPt, const SkVector& normal) { 353 void SkPathStroker::line_to(const SkPoint& currPt, const SkVector& normal) {
354 fOuter.lineTo(currPt.fX + normal.fX, currPt.fY + normal.fY); 354 fOuter.lineTo(currPt.fX + normal.fX, currPt.fY + normal.fY);
355 fInner.lineTo(currPt.fX - normal.fX, currPt.fY - normal.fY); 355 fInner.lineTo(currPt.fX - normal.fX, currPt.fY - normal.fY);
356 } 356 }
357 357
358 void SkPathStroker::lineTo(const SkPoint& currPt) { 358 void SkPathStroker::lineTo(const SkPoint& currPt) {
359 if (SkPath::IsLineDegenerate(fPrevPt, currPt)) { 359 if (SkPath::IsLineDegenerate(fPrevPt, currPt, false)) {
360 return; 360 return;
361 } 361 }
362 SkVector normal, unitNormal; 362 SkVector normal, unitNormal;
363 363
364 if (!this->preJoinTo(currPt, &normal, &unitNormal, true)) { 364 if (!this->preJoinTo(currPt, &normal, &unitNormal, true)) {
365 return; 365 return;
366 } 366 }
367 this->line_to(currPt, normal); 367 this->line_to(currPt, normal);
368 this->postJoinTo(currPt, normal, unitNormal); 368 this->postJoinTo(currPt, normal, unitNormal);
369 } 369 }
(...skipping 1080 matching lines...) Expand 10 before | Expand all | Expand 10 after
1450 default: 1450 default:
1451 break; 1451 break;
1452 } 1452 }
1453 1453
1454 if (fWidth < SkMinScalar(rw, rh) && !fDoFill) { 1454 if (fWidth < SkMinScalar(rw, rh) && !fDoFill) {
1455 r = rect; 1455 r = rect;
1456 r.inset(radius, radius); 1456 r.inset(radius, radius);
1457 dst->addRect(r, reverse_direction(dir)); 1457 dst->addRect(r, reverse_direction(dir));
1458 } 1458 }
1459 } 1459 }
OLDNEW
« no previous file with comments | « src/core/SkPath.cpp ('k') | tests/PathTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698