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

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

Issue 1842753002: Style bikeshed - remove extraneous whitespace (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 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') | src/core/SkPathPriv.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1
2 /* 1 /*
3 * Copyright 2008 The Android Open Source Project 2 * Copyright 2008 The Android Open Source Project
4 * 3 *
5 * 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
6 * found in the LICENSE file. 5 * found in the LICENSE file.
7 */ 6 */
8 7
9 8
10 #include "SkPathMeasure.h" 9 #include "SkPathMeasure.h"
11 #include "SkGeometry.h" 10 #include "SkGeometry.h"
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 SkASSERT(fLength >= 0); 519 SkASSERT(fLength >= 0);
521 return fLength; 520 return fLength;
522 } 521 }
523 522
524 template <typename T, typename K> 523 template <typename T, typename K>
525 int SkTKSearch(const T base[], int count, const K& key) { 524 int SkTKSearch(const T base[], int count, const K& key) {
526 SkASSERT(count >= 0); 525 SkASSERT(count >= 0);
527 if (count <= 0) { 526 if (count <= 0) {
528 return ~0; 527 return ~0;
529 } 528 }
530 529
531 SkASSERT(base != nullptr); // base may be nullptr if count is zero 530 SkASSERT(base != nullptr); // base may be nullptr if count is zero
532 531
533 int lo = 0; 532 int lo = 0;
534 int hi = count - 1; 533 int hi = count - 1;
535 534
536 while (lo < hi) { 535 while (lo < hi) {
537 int mid = (hi + lo) >> 1; 536 int mid = (hi + lo) >> 1;
538 if (base[mid].fDistance < key) { 537 if (base[mid].fDistance < key) {
539 lo = mid + 1; 538 lo = mid + 1;
540 } else { 539 } else {
541 hi = mid; 540 hi = mid;
542 } 541 }
543 } 542 }
544 543
545 if (base[hi].fDistance < key) { 544 if (base[hi].fDistance < key) {
546 hi += 1; 545 hi += 1;
547 hi = ~hi; 546 hi = ~hi;
548 } else if (key < base[hi].fDistance) { 547 } else if (key < base[hi].fDistance) {
549 hi = ~hi; 548 hi = ~hi;
550 } 549 }
551 return hi; 550 return hi;
552 } 551 }
553 552
554 const SkPathMeasure::Segment* SkPathMeasure::distanceToSegment( 553 const SkPathMeasure::Segment* SkPathMeasure::distanceToSegment(
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 702
704 for (int i = 0; i < fSegments.count(); i++) { 703 for (int i = 0; i < fSegments.count(); i++) {
705 const Segment* seg = &fSegments[i]; 704 const Segment* seg = &fSegments[i];
706 SkDebugf("pathmeas: seg[%d] distance=%g, point=%d, t=%g, type=%d\n", 705 SkDebugf("pathmeas: seg[%d] distance=%g, point=%d, t=%g, type=%d\n",
707 i, seg->fDistance, seg->fPtIndex, seg->getScalarT(), 706 i, seg->fDistance, seg->fPtIndex, seg->getScalarT(),
708 seg->fType); 707 seg->fType);
709 } 708 }
710 } 709 }
711 710
712 #endif 711 #endif
OLDNEW
« no previous file with comments | « src/core/SkPath.cpp ('k') | src/core/SkPathPriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698