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

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

Issue 460813002: Fallback to moveTo when unable to find the first tangent in cubicTo (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: is -> was Created 6 years, 3 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 | « no previous file | 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 "SkPath.h" 10 #include "SkPath.h"
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 417
418 this->postJoinTo(pt2, normalBC, unitBC); 418 this->postJoinTo(pt2, normalBC, unitBC);
419 } 419 }
420 420
421 void SkPathStroker::cubicTo(const SkPoint& pt1, const SkPoint& pt2, 421 void SkPathStroker::cubicTo(const SkPoint& pt1, const SkPoint& pt2,
422 const SkPoint& pt3) { 422 const SkPoint& pt3) {
423 bool degenerateAB = SkPath::IsLineDegenerate(fPrevPt, pt1); 423 bool degenerateAB = SkPath::IsLineDegenerate(fPrevPt, pt1);
424 bool degenerateBC = SkPath::IsLineDegenerate(pt1, pt2); 424 bool degenerateBC = SkPath::IsLineDegenerate(pt1, pt2);
425 bool degenerateCD = SkPath::IsLineDegenerate(pt2, pt3); 425 bool degenerateCD = SkPath::IsLineDegenerate(pt2, pt3);
426 426
427 if (degenerateAB + degenerateBC + degenerateCD >= 2) { 427 if (degenerateAB + degenerateBC + degenerateCD >= 2
428 || (degenerateAB && SkPath::IsLineDegenerate(fPrevPt, pt2))) {
428 this->lineTo(pt3); 429 this->lineTo(pt3);
429 return; 430 return;
430 } 431 }
431 432
432 SkVector normalAB, unitAB, normalCD, unitCD; 433 SkVector normalAB, unitAB, normalCD, unitCD;
433 434
434 // find the first tangent (which might be pt1 or pt2 435 // find the first tangent (which might be pt1 or pt2
435 { 436 {
436 const SkPoint* nextPt = &pt1; 437 const SkPoint* nextPt = &pt1;
437 if (degenerateAB) 438 if (degenerateAB)
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
725 default: 726 default:
726 break; 727 break;
727 } 728 }
728 729
729 if (fWidth < SkMinScalar(rw, rh) && !fDoFill) { 730 if (fWidth < SkMinScalar(rw, rh) && !fDoFill) {
730 r = rect; 731 r = rect;
731 r.inset(radius, radius); 732 r.inset(radius, radius);
732 dst->addRect(r, reverse_direction(dir)); 733 dst->addRect(r, reverse_direction(dir));
733 } 734 }
734 } 735 }
OLDNEW
« no previous file with comments | « no previous file | tests/PathTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698