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

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

Issue 1413763002: path ops: fix conic weight and partial coincidence (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove samplecode changes 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
407 #include "SkOpAngle.h" 411 #include "SkOpAngle.h"
408 #include "SkOpSegment.h" 412 #include "SkOpSegment.h"
409 413
410 #if DEBUG_COINCIDENCE 414 #if DEBUG_COINCIDENCE
411 void SkOpSegment::debugAddAlignIntersection(const char* id, SkPathOpsDebug::Glit chLog* log, 415 void SkOpSegment::debugAddAlignIntersection(const char* id, SkPathOpsDebug::Glit chLog* log,
412 const SkOpPtT& endPtT, const SkPoint& oldPt, const SkOpContourHead* con tourList) const { 416 const SkOpPtT& endPtT, const SkPoint& oldPt, const SkOpContourHead* con tourList) const {
413 const SkPoint& newPt = endPtT.fPt; 417 const SkPoint& newPt = endPtT.fPt;
414 if (newPt == oldPt) { 418 if (newPt == oldPt) {
415 return; 419 return;
416 } 420 }
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after
1106 1110
1107 1111
1108 #if DEBUG_COINCIDENCE 1112 #if DEBUG_COINCIDENCE
1109 void SkOpCoincidence::debugAddExpanded(const char* id, SkPathOpsDebug::GlitchLog * log) const { 1113 void SkOpCoincidence::debugAddExpanded(const char* id, SkPathOpsDebug::GlitchLog * log) const {
1110 // for each coincident pair, match the spans 1114 // for each coincident pair, match the spans
1111 // if the spans don't match, add the mssing pt to the segment and loop it in the opposite span 1115 // if the spans don't match, add the mssing pt to the segment and loop it in the opposite span
1112 const SkCoincidentSpans* coin = this->fHead; 1116 const SkCoincidentSpans* coin = this->fHead;
1113 if (!coin) { 1117 if (!coin) {
1114 coin = this->fTop; 1118 coin = this->fTop;
1115 } 1119 }
1116 SkASSERT(coin); 1120 if (!coin) {
1121 return;
1122 }
1117 do { 1123 do {
1118 const SkOpPtT* startPtT = coin->fCoinPtTStart; 1124 const SkOpPtT* startPtT = coin->fCoinPtTStart;
1119 const SkOpPtT* oStartPtT = coin->fOppPtTStart; 1125 const SkOpPtT* oStartPtT = coin->fOppPtTStart;
1120 SkASSERT(startPtT->contains(oStartPtT)); 1126 SkASSERT(startPtT->contains(oStartPtT));
1121 SkASSERT(coin->fCoinPtTEnd->contains(coin->fOppPtTEnd)); 1127 SkASSERT(coin->fCoinPtTEnd->contains(coin->fOppPtTEnd));
1122 const SkOpSpanBase* start = startPtT->span(); 1128 const SkOpSpanBase* start = startPtT->span();
1123 const SkOpSpanBase* oStart = oStartPtT->span(); 1129 const SkOpSpanBase* oStart = oStartPtT->span();
1124 const SkOpSpanBase* end = coin->fCoinPtTEnd->span(); 1130 const SkOpSpanBase* end = coin->fCoinPtTEnd->span();
1125 const SkOpSpanBase* oEnd = coin->fOppPtTEnd->span(); 1131 const SkOpSpanBase* oEnd = coin->fOppPtTEnd->span();
1126 const SkOpSpanBase* test = start->upCast()->next(); 1132 const SkOpSpanBase* test = start->upCast()->next();
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after
1839 #endif 1845 #endif
1840 SkPath::FillType fillType = path.getFillType(); 1846 SkPath::FillType fillType = path.getFillType();
1841 SkASSERT(fillType >= SkPath::kWinding_FillType && fillType <= SkPath::kInver seEvenOdd_FillType); 1847 SkASSERT(fillType >= SkPath::kWinding_FillType && fillType <= SkPath::kInver seEvenOdd_FillType);
1842 if (includeDeclaration) { 1848 if (includeDeclaration) {
1843 SkDebugf(" SkPath %s;\n", name); 1849 SkDebugf(" SkPath %s;\n", name);
1844 } 1850 }
1845 SkDebugf(" %s.setFillType(SkPath::%s);\n", name, gFillTypeStr[fillType]); 1851 SkDebugf(" %s.setFillType(SkPath::%s);\n", name, gFillTypeStr[fillType]);
1846 iter.setPath(path); 1852 iter.setPath(path);
1847 showPathContours(iter, name); 1853 showPathContours(iter, name);
1848 } 1854 }
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