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

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

Issue 1301763006: fix override (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: experiment with zero-length round capped line segments 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 | « gm/strokes.cpp ('k') | src/core/SkStroke.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 2008 The Android Open Source Project 3 * Copyright 2008 The Android Open Source Project
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 9
10 #include "SkPathMeasure.h" 10 #include "SkPathMeasure.h"
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 } 307 }
308 } 308 }
309 309
310 static void seg_to(const SkPoint pts[], int segType, 310 static void seg_to(const SkPoint pts[], int segType,
311 SkScalar startT, SkScalar stopT, SkPath* dst) { 311 SkScalar startT, SkScalar stopT, SkPath* dst) {
312 SkASSERT(startT >= 0 && startT <= SK_Scalar1); 312 SkASSERT(startT >= 0 && startT <= SK_Scalar1);
313 SkASSERT(stopT >= 0 && stopT <= SK_Scalar1); 313 SkASSERT(stopT >= 0 && stopT <= SK_Scalar1);
314 SkASSERT(startT <= stopT); 314 SkASSERT(startT <= stopT);
315 315
316 if (startT == stopT) { 316 if (startT == stopT) {
317 return; // should we report this, to undo a moveTo? 317 SkPoint lastPt;
318 SkAssertResult(dst->getLastPt(&lastPt));
319 dst->lineTo(lastPt);
320 return;
318 } 321 }
319 322
320 SkPoint tmp0[7], tmp1[7]; 323 SkPoint tmp0[7], tmp1[7];
321 324
322 switch (segType) { 325 switch (segType) {
323 case kLine_SegType: 326 case kLine_SegType:
324 if (SK_Scalar1 == stopT) { 327 if (SK_Scalar1 == stopT) {
325 dst->lineTo(pts[1]); 328 dst->lineTo(pts[1]);
326 } else { 329 } else {
327 dst->lineTo(SkScalarInterp(pts[0].fX, pts[1].fX, stopT), 330 dst->lineTo(SkScalarInterp(pts[0].fX, pts[1].fX, stopT),
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 SkASSERT(dst); 564 SkASSERT(dst);
562 565
563 SkScalar length = this->getLength(); // ensure we have built our segments 566 SkScalar length = this->getLength(); // ensure we have built our segments
564 567
565 if (startD < 0) { 568 if (startD < 0) {
566 startD = 0; 569 startD = 0;
567 } 570 }
568 if (stopD > length) { 571 if (stopD > length) {
569 stopD = length; 572 stopD = length;
570 } 573 }
571 if (startD >= stopD) { 574 if (startD > stopD) {
572 return false; 575 return false;
573 } 576 }
574 577
575 SkPoint p; 578 SkPoint p;
576 SkScalar startT, stopT; 579 SkScalar startT, stopT;
577 const Segment* seg = this->distanceToSegment(startD, &startT); 580 const Segment* seg = this->distanceToSegment(startD, &startT);
578 const Segment* stopSeg = this->distanceToSegment(stopD, &stopT); 581 const Segment* stopSeg = this->distanceToSegment(stopD, &stopT);
579 SkASSERT(seg <= stopSeg); 582 SkASSERT(seg <= stopSeg);
580 583
581 if (startWithMoveTo) { 584 if (startWithMoveTo) {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 622
620 for (int i = 0; i < fSegments.count(); i++) { 623 for (int i = 0; i < fSegments.count(); i++) {
621 const Segment* seg = &fSegments[i]; 624 const Segment* seg = &fSegments[i];
622 SkDebugf("pathmeas: seg[%d] distance=%g, point=%d, t=%g, type=%d\n", 625 SkDebugf("pathmeas: seg[%d] distance=%g, point=%d, t=%g, type=%d\n",
623 i, seg->fDistance, seg->fPtIndex, seg->getScalarT(), 626 i, seg->fDistance, seg->fPtIndex, seg->getScalarT(),
624 seg->fType); 627 seg->fType);
625 } 628 }
626 } 629 }
627 630
628 #endif 631 #endif
OLDNEW
« no previous file with comments | « gm/strokes.cpp ('k') | src/core/SkStroke.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698