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

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

Issue 1096923003: working on initial winding for cubics (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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/pathops/SkPathOpsDebug.h ('k') | src/pathops/SkPathOpsOp.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 * 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 "SkPathOpsDebug.h" 8 #include "SkPathOpsDebug.h"
9 #include "SkPath.h" 9 #include "SkPath.h"
10 #include "SkString.h" 10 #include "SkString.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 } 108 }
109 109
110 static const char* gOpStrs[] = { 110 static const char* gOpStrs[] = {
111 "kDifference_SkPathOp", 111 "kDifference_SkPathOp",
112 "kIntersect_SkPathOp", 112 "kIntersect_SkPathOp",
113 "kUnion_SkPathOp", 113 "kUnion_SkPathOp",
114 "kXor_PathOp", 114 "kXor_PathOp",
115 "kReverseDifference_SkPathOp", 115 "kReverseDifference_SkPathOp",
116 }; 116 };
117 117
118 const char* SkPathOpsDebug::OpStr(SkPathOp op) {
119 return gOpStrs[op];
120 }
121
118 static void show_op(SkPathOp op, const char* pathOne, const char* pathTwo) { 122 static void show_op(SkPathOp op, const char* pathOne, const char* pathTwo) {
119 SkDebugf(" testPathOp(reporter, %s, %s, %s, filename);\n", pathOne, pathT wo, gOpStrs[op]); 123 SkDebugf(" testPathOp(reporter, %s, %s, %s, filename);\n", pathOne, pathT wo, gOpStrs[op]);
120 SkDebugf("}\n"); 124 SkDebugf("}\n");
121 } 125 }
122 126
123 SK_DECLARE_STATIC_MUTEX(gTestMutex); 127 SK_DECLARE_STATIC_MUTEX(gTestMutex);
124 128
125 void SkPathOpsDebug::ShowPath(const SkPath& a, const SkPath& b, SkPathOp shapeOp , 129 void SkPathOpsDebug::ShowPath(const SkPath& a, const SkPath& b, SkPathOp shapeOp ,
126 const char* testName) { 130 const char* testName) {
127 SkAutoMutexAcquire ac(gTestMutex); 131 SkAutoMutexAcquire ac(gTestMutex);
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 result.printf(CUBIC_DEBUG_STR " id=%d", CUBIC_DEBUG_DATA(fCurvePart) , 290 result.printf(CUBIC_DEBUG_STR " id=%d", CUBIC_DEBUG_DATA(fCurvePart) ,
287 this->segment()->debugID()); 291 this->segment()->debugID());
288 break; 292 break;
289 default: 293 default:
290 SkASSERT(0); 294 SkASSERT(0);
291 } 295 }
292 return result; 296 return result;
293 } 297 }
294 #endif 298 #endif
295 299
296 #if DEBUG_SORT 300 #if DEBUG_SORT || DEBUG_SWAP_TOP
297 void SkOpAngle::debugLoop() const { 301 void SkOpAngle::debugLoop() const {
298 const SkOpAngle* first = this; 302 const SkOpAngle* first = this;
299 const SkOpAngle* next = this; 303 const SkOpAngle* next = this;
300 do { 304 do {
301 next->dumpOne(true); 305 next->dumpOne(true);
302 SkDebugf("\n"); 306 SkDebugf("\n");
303 next = next->fNext; 307 next = next->fNext;
304 } while (next && next != first); 308 } while (next && next != first);
305 next = first; 309 next = first;
306 do { 310 do {
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 #endif 605 #endif
602 SkPath::FillType fillType = path.getFillType(); 606 SkPath::FillType fillType = path.getFillType();
603 SkASSERT(fillType >= SkPath::kWinding_FillType && fillType <= SkPath::kInver seEvenOdd_FillType); 607 SkASSERT(fillType >= SkPath::kWinding_FillType && fillType <= SkPath::kInver seEvenOdd_FillType);
604 if (includeDeclaration) { 608 if (includeDeclaration) {
605 SkDebugf(" SkPath %s;\n", name); 609 SkDebugf(" SkPath %s;\n", name);
606 } 610 }
607 SkDebugf(" %s.setFillType(SkPath::%s);\n", name, gFillTypeStr[fillType]); 611 SkDebugf(" %s.setFillType(SkPath::%s);\n", name, gFillTypeStr[fillType]);
608 iter.setPath(path); 612 iter.setPath(path);
609 showPathContours(iter, name); 613 showPathContours(iter, name);
610 } 614 }
OLDNEW
« no previous file with comments | « src/pathops/SkPathOpsDebug.h ('k') | src/pathops/SkPathOpsOp.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698