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

Side by Side Diff: tests/PathOpsAngleTest.cpp

Issue 2273293004: path ops stream-lining (Closed)
Patch Set: remove commented out code Created 4 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 | « src/pathops/SkPathOpsTypes.h ('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 2013 Google Inc. 2 * Copyright 2013 Google Inc.
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 #include "PathOpsTestCommon.h" 7 #include "PathOpsTestCommon.h"
8 #include "SkIntersections.h" 8 #include "SkIntersections.h"
9 #include "SkOpContour.h" 9 #include "SkOpContour.h"
10 #include "SkOpSegment.h" 10 #include "SkOpSegment.h"
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 // match the expected result. The tests above return 1 when first added, but 471 // match the expected result. The tests above return 1 when first added, but
472 // return 0 after the bug is fixed. 472 // return 0 after the bug is fixed.
473 SkDEBUGCODE(int result =) PathOpsAngleTester::After(angle2, angle1); 473 SkDEBUGCODE(int result =) PathOpsAngleTester::After(angle2, angle1);
474 SkASSERT(result == 0 || result == 1); 474 SkASSERT(result == 0 || result == 1);
475 } 475 }
476 } 476 }
477 } 477 }
478 478
479 void SkOpSegment::debugAddAngle(double startT, double endT) { 479 void SkOpSegment::debugAddAngle(double startT, double endT) {
480 SkOpPtT* startPtT = startT == 0 ? fHead.ptT() : startT == 1 ? fTail.ptT() 480 SkOpPtT* startPtT = startT == 0 ? fHead.ptT() : startT == 1 ? fTail.ptT()
481 : this->addT(startT, nullptr); 481 : this->addT(startT);
482 SkOpPtT* endPtT = endT == 0 ? fHead.ptT() : endT == 1 ? fTail.ptT() 482 SkOpPtT* endPtT = endT == 0 ? fHead.ptT() : endT == 1 ? fTail.ptT()
483 : this->addT(endT, nullptr); 483 : this->addT(endT);
484 SkOpAngle* angle = SkOpTAllocator<SkOpAngle>::Allocate(this->globalState()-> allocator()); 484 SkOpAngle* angle = SkOpTAllocator<SkOpAngle>::Allocate(this->globalState()-> allocator());
485 SkOpSpanBase* startSpan = &fHead; 485 SkOpSpanBase* startSpan = &fHead;
486 while (startSpan->ptT() != startPtT) { 486 while (startSpan->ptT() != startPtT) {
487 startSpan = startSpan->upCast()->next(); 487 startSpan = startSpan->upCast()->next();
488 } 488 }
489 SkOpSpanBase* endSpan = &fHead; 489 SkOpSpanBase* endSpan = &fHead;
490 while (endSpan->ptT() != endPtT) { 490 while (endSpan->ptT() != endPtT) {
491 endSpan = endSpan->upCast()->next(); 491 endSpan = endSpan->upCast()->next();
492 } 492 }
493 angle->set(startSpan, endSpan); 493 angle->set(startSpan, endSpan);
(...skipping 24 matching lines...) Expand all
518 SkOpSegment* first = contour.first(); 518 SkOpSegment* first = contour.first();
519 first->debugAddAngle(0, 1); 519 first->debugAddAngle(0, 1);
520 SkOpSegment* next = first->next(); 520 SkOpSegment* next = first->next();
521 next->debugAddAngle(0, 1); 521 next->debugAddAngle(0, 1);
522 /* int result = */ 522 /* int result = */
523 PathOpsAngleTester::AllOnOneSide(*first->debugLastAngle(), *next->de bugLastAngle()); 523 PathOpsAngleTester::AllOnOneSide(*first->debugLastAngle(), *next->de bugLastAngle());
524 // SkDebugf("i=%d result=%d\n", i , result); 524 // SkDebugf("i=%d result=%d\n", i , result);
525 // SkDebugf(""); 525 // SkDebugf("");
526 } 526 }
527 } 527 }
OLDNEW
« no previous file with comments | « src/pathops/SkPathOpsTypes.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698