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

Side by Side Diff: src/pathops/SkPathOpsDebug.cpp

Issue 1408923003: Revert of path ops: fix conic weight and partial coincidence (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 2 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/SkPathOpsDebug.h ('k') | src/pathops/SkPathOpsQuad.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 /* 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 7
8 #include "SkMutex.h" 8 #include "SkMutex.h"
9 #include "SkOpCoincidence.h" 9 #include "SkOpCoincidence.h"
10 #include "SkOpContour.h" 10 #include "SkOpContour.h"
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 cubic[0] = fPts[0]; 397 cubic[0] = fPts[0];
398 cubic[2] = fPts[1]; 398 cubic[2] = fPts[1];
399 cubic[3] = fPts[2]; 399 cubic[3] = fPts[2];
400 cubic[1].fX = (cubic[0].fX + cubic[2].fX * 2) / 3; 400 cubic[1].fX = (cubic[0].fX + cubic[2].fX * 2) / 3;
401 cubic[1].fY = (cubic[0].fY + cubic[2].fY * 2) / 3; 401 cubic[1].fY = (cubic[0].fY + cubic[2].fY * 2) / 3;
402 cubic[2].fX = (cubic[3].fX + cubic[2].fX * 2) / 3; 402 cubic[2].fX = (cubic[3].fX + cubic[2].fX * 2) / 3;
403 cubic[2].fY = (cubic[3].fY + cubic[2].fY * 2) / 3; 403 cubic[2].fY = (cubic[3].fY + cubic[2].fY * 2) / 3;
404 return cubic; 404 return cubic;
405 } 405 }
406 406
407 void SkDRect::debugInit() {
408 fLeft = fTop = fRight = fBottom = SK_ScalarNaN;
409 }
410
411 #include "SkOpAngle.h" 407 #include "SkOpAngle.h"
412 #include "SkOpSegment.h" 408 #include "SkOpSegment.h"
413 409
414 #if DEBUG_COINCIDENCE 410 #if DEBUG_COINCIDENCE
415 void SkOpSegment::debugAddAlignIntersection(const char* id, SkPathOpsDebug::Glit chLog* log, 411 void SkOpSegment::debugAddAlignIntersection(const char* id, SkPathOpsDebug::Glit chLog* log,
416 const SkOpPtT& endPtT, const SkPoint& oldPt, const SkOpContourHead* con tourList) const { 412 const SkOpPtT& endPtT, const SkPoint& oldPt, const SkOpContourHead* con tourList) const {
417 const SkPoint& newPt = endPtT.fPt; 413 const SkPoint& newPt = endPtT.fPt;
418 if (newPt == oldPt) { 414 if (newPt == oldPt) {
419 return; 415 return;
420 } 416 }
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after
1110 1106
1111 1107
1112 #if DEBUG_COINCIDENCE 1108 #if DEBUG_COINCIDENCE
1113 void SkOpCoincidence::debugAddExpanded(const char* id, SkPathOpsDebug::GlitchLog * log) const { 1109 void SkOpCoincidence::debugAddExpanded(const char* id, SkPathOpsDebug::GlitchLog * log) const {
1114 // for each coincident pair, match the spans 1110 // for each coincident pair, match the spans
1115 // if the spans don't match, add the mssing pt to the segment and loop it in the opposite span 1111 // if the spans don't match, add the mssing pt to the segment and loop it in the opposite span
1116 const SkCoincidentSpans* coin = this->fHead; 1112 const SkCoincidentSpans* coin = this->fHead;
1117 if (!coin) { 1113 if (!coin) {
1118 coin = this->fTop; 1114 coin = this->fTop;
1119 } 1115 }
1120 if (!coin) { 1116 SkASSERT(coin);
1121 return;
1122 }
1123 do { 1117 do {
1124 const SkOpPtT* startPtT = coin->fCoinPtTStart; 1118 const SkOpPtT* startPtT = coin->fCoinPtTStart;
1125 const SkOpPtT* oStartPtT = coin->fOppPtTStart; 1119 const SkOpPtT* oStartPtT = coin->fOppPtTStart;
1126 SkASSERT(startPtT->contains(oStartPtT)); 1120 SkASSERT(startPtT->contains(oStartPtT));
1127 SkASSERT(coin->fCoinPtTEnd->contains(coin->fOppPtTEnd)); 1121 SkASSERT(coin->fCoinPtTEnd->contains(coin->fOppPtTEnd));
1128 const SkOpSpanBase* start = startPtT->span(); 1122 const SkOpSpanBase* start = startPtT->span();
1129 const SkOpSpanBase* oStart = oStartPtT->span(); 1123 const SkOpSpanBase* oStart = oStartPtT->span();
1130 const SkOpSpanBase* end = coin->fCoinPtTEnd->span(); 1124 const SkOpSpanBase* end = coin->fCoinPtTEnd->span();
1131 const SkOpSpanBase* oEnd = coin->fOppPtTEnd->span(); 1125 const SkOpSpanBase* oEnd = coin->fOppPtTEnd->span();
1132 const SkOpSpanBase* test = start->upCast()->next(); 1126 const SkOpSpanBase* test = start->upCast()->next();
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after
1845 #endif 1839 #endif
1846 SkPath::FillType fillType = path.getFillType(); 1840 SkPath::FillType fillType = path.getFillType();
1847 SkASSERT(fillType >= SkPath::kWinding_FillType && fillType <= SkPath::kInver seEvenOdd_FillType); 1841 SkASSERT(fillType >= SkPath::kWinding_FillType && fillType <= SkPath::kInver seEvenOdd_FillType);
1848 if (includeDeclaration) { 1842 if (includeDeclaration) {
1849 SkDebugf(" SkPath %s;\n", name); 1843 SkDebugf(" SkPath %s;\n", name);
1850 } 1844 }
1851 SkDebugf(" %s.setFillType(SkPath::%s);\n", name, gFillTypeStr[fillType]); 1845 SkDebugf(" %s.setFillType(SkPath::%s);\n", name, gFillTypeStr[fillType]);
1852 iter.setPath(path); 1846 iter.setPath(path);
1853 showPathContours(iter, name); 1847 showPathContours(iter, name);
1854 } 1848 }
OLDNEW
« no previous file with comments | « src/pathops/SkPathOpsDebug.h ('k') | src/pathops/SkPathOpsQuad.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698