| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "SkAddIntersections.h" | 7 #include "SkAddIntersections.h" |
| 8 #include "SkOpCoincidence.h" | 8 #include "SkOpCoincidence.h" |
| 9 #include "SkOpEdgeBuilder.h" | 9 #include "SkOpEdgeBuilder.h" |
| 10 #include "SkPathOpsCommon.h" | 10 #include "SkPathOpsCommon.h" |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 fprintf(file, " path.setFillType((SkPath::FillType) %d);\n", two.getFillT
ype()); | 216 fprintf(file, " path.setFillType((SkPath::FillType) %d);\n", two.getFillT
ype()); |
| 217 dump_path(file, two, false, true); | 217 dump_path(file, two, false, true); |
| 218 fprintf(file, " SkPath path2(path);\n"); | 218 fprintf(file, " SkPath path2(path);\n"); |
| 219 fprintf(file, " testPathOp(reporter, path1, path2, (SkPathOp) %d, filenam
e);\n", op); | 219 fprintf(file, " testPathOp(reporter, path1, path2, (SkPathOp) %d, filenam
e);\n", op); |
| 220 fprintf(file, "}\n"); | 220 fprintf(file, "}\n"); |
| 221 fclose(file); | 221 fclose(file); |
| 222 } | 222 } |
| 223 #endif | 223 #endif |
| 224 | 224 |
| 225 bool OpDebug(const SkPath& one, const SkPath& two, SkPathOp op, SkPath* result, | 225 bool OpDebug(const SkPath& one, const SkPath& two, SkPathOp op, SkPath* result, |
| 226 bool expectSuccess) { | 226 bool expectSuccess SkDEBUGPARAMS(const char* testName)) { |
| 227 SkChunkAlloc allocator(4096); // FIXME: add a constant expression here, tun
e | 227 SkChunkAlloc allocator(4096); // FIXME: add a constant expression here, tun
e |
| 228 SkOpContour contour; | 228 SkOpContour contour; |
| 229 SkOpContourHead* contourList = static_cast<SkOpContourHead*>(&contour); | 229 SkOpContourHead* contourList = static_cast<SkOpContourHead*>(&contour); |
| 230 SkOpCoincidence coincidence; | 230 SkOpCoincidence coincidence; |
| 231 SkOpGlobalState globalState(&coincidence, contourList); | 231 SkOpGlobalState globalState(&coincidence, contourList SkDEBUGPARAMS(testNam
e)); |
| 232 #if DEBUGGING_PATHOPS_FROM_HOST | 232 #if DEBUGGING_PATHOPS_FROM_HOST |
| 233 dump_op(one, two, op); | 233 dump_op(one, two, op); |
| 234 #endif | 234 #endif |
| 235 #if 0 && DEBUG_SHOW_TEST_NAME | 235 #if 0 && DEBUG_SHOW_TEST_NAME |
| 236 char* debugName = DEBUG_FILENAME_STRING; | 236 char* debugName = DEBUG_FILENAME_STRING; |
| 237 if (debugName && debugName[0]) { | 237 if (debugName && debugName[0]) { |
| 238 SkPathOpsDebug::BumpTestName(debugName); | 238 SkPathOpsDebug::BumpTestName(debugName); |
| 239 SkPathOpsDebug::ShowPath(one, two, op, debugName); | 239 SkPathOpsDebug::ShowPath(one, two, op, debugName); |
| 240 } | 240 } |
| 241 #endif | 241 #endif |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 temp.setFillType(fillType); | 297 temp.setFillType(fillType); |
| 298 SkPathWriter assembled(temp); | 298 SkPathWriter assembled(temp); |
| 299 Assemble(wrapper, &assembled); | 299 Assemble(wrapper, &assembled); |
| 300 *result = *assembled.nativePath(); | 300 *result = *assembled.nativePath(); |
| 301 result->setFillType(fillType); | 301 result->setFillType(fillType); |
| 302 } | 302 } |
| 303 return true; | 303 return true; |
| 304 } | 304 } |
| 305 | 305 |
| 306 bool Op(const SkPath& one, const SkPath& two, SkPathOp op, SkPath* result) { | 306 bool Op(const SkPath& one, const SkPath& two, SkPathOp op, SkPath* result) { |
| 307 return OpDebug(one, two, op, result, true); | 307 return OpDebug(one, two, op, result, true SkDEBUGPARAMS(NULL)); |
| 308 } | 308 } |
| OLD | NEW |