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

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

Issue 1805913002: skip stroke outset of all teeny lines (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: simplify example Created 4 years, 9 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 | « gm/arcto.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 * 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 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 return true; 399 return true;
400 case SkPath::kClose_Verb: 400 case SkPath::kClose_Verb:
401 case SkPath::kDone_Verb: 401 case SkPath::kDone_Verb:
402 return false; 402 return false;
403 } 403 }
404 } 404 }
405 return false; 405 return false;
406 } 406 }
407 407
408 void SkPathStroker::lineTo(const SkPoint& currPt, const SkPath::Iter* iter) { 408 void SkPathStroker::lineTo(const SkPoint& currPt, const SkPath::Iter* iter) {
409 if (SkStrokerPriv::CapFactory(SkPaint::kButt_Cap) == fCapper 409 bool teenyLine = fPrevPt.equalsWithinTolerance(currPt, SK_ScalarNearlyZero * fInvResScale);
410 && fPrevPt.equalsWithinTolerance(currPt, SK_ScalarNearlyZero * fInvR esScale)) { 410 if (SkStrokerPriv::CapFactory(SkPaint::kButt_Cap) == fCapper && teenyLine) {
411 return; 411 return;
412 } 412 }
413 if (fPrevPt == currPt && (fJoinCompleted || (iter && has_valid_tangent(iter) ))) { 413 if (teenyLine && (fJoinCompleted || (iter && has_valid_tangent(iter)))) {
414 return; 414 return;
415 } 415 }
416 SkVector normal, unitNormal; 416 SkVector normal, unitNormal;
417 417
418 if (!this->preJoinTo(currPt, &normal, &unitNormal, true)) { 418 if (!this->preJoinTo(currPt, &normal, &unitNormal, true)) {
419 return; 419 return;
420 } 420 }
421 this->line_to(currPt, normal); 421 this->line_to(currPt, normal);
422 this->postJoinTo(currPt, normal, unitNormal); 422 this->postJoinTo(currPt, normal, unitNormal);
423 } 423 }
(...skipping 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after
1531 default: 1531 default:
1532 break; 1532 break;
1533 } 1533 }
1534 1534
1535 if (fWidth < SkMinScalar(rw, rh) && !fDoFill) { 1535 if (fWidth < SkMinScalar(rw, rh) && !fDoFill) {
1536 r = rect; 1536 r = rect;
1537 r.inset(radius, radius); 1537 r.inset(radius, radius);
1538 dst->addRect(r, reverse_direction(dir)); 1538 dst->addRect(r, reverse_direction(dir));
1539 } 1539 }
1540 } 1540 }
OLDNEW
« no previous file with comments | « gm/arcto.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698