| 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 | 7 |
| 8 #include "PathOpsExtendedTest.h" | 8 #include "PathOpsExtendedTest.h" |
| 9 #include "PathOpsThreadedCommon.h" | 9 #include "PathOpsThreadedCommon.h" |
| 10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 const SkPathOp shapeOp, const SkMatrix& scale) { | 403 const SkPathOp shapeOp, const SkMatrix& scale) { |
| 404 SkASSERT((unsigned) shapeOp < SK_ARRAY_COUNT(opStrs)); | 404 SkASSERT((unsigned) shapeOp < SK_ARRAY_COUNT(opStrs)); |
| 405 SkString defaultTestName; | 405 SkString defaultTestName; |
| 406 if (!testName) { | 406 if (!testName) { |
| 407 defaultTestName.printf("xOp%d%s", gTestNo, opSuffixes[shapeOp]); | 407 defaultTestName.printf("xOp%d%s", gTestNo, opSuffixes[shapeOp]); |
| 408 testName = defaultTestName.c_str(); | 408 testName = defaultTestName.c_str(); |
| 409 } | 409 } |
| 410 SkDebugf("static void %s(skiatest::Reporter* reporter, const char* filename)
{\n", testName); | 410 SkDebugf("static void %s(skiatest::Reporter* reporter, const char* filename)
{\n", testName); |
| 411 *gTestOp.append() = shapeOp; | 411 *gTestOp.append() = shapeOp; |
| 412 ++gTestNo; | 412 ++gTestNo; |
| 413 SkDebugf("\n*** this test fails ***\n"); |
| 413 SkDebugf(" SkPath path, pathB;\n"); | 414 SkDebugf(" SkPath path, pathB;\n"); |
| 414 showPath(a, "path", false); | 415 showPath(a, "path", false); |
| 415 showPath(b, "pathB", false); | 416 showPath(b, "pathB", false); |
| 416 SkDebugf(" testPathOp(reporter, path, pathB, %s, filename);\n", opStrs[sh
apeOp]); | 417 SkDebugf(" testPathOp(reporter, path, pathB, %s, filename);\n", opStrs[sh
apeOp]); |
| 417 SkDebugf("}\n"); | 418 SkDebugf("}\n"); |
| 418 drawAsciiPaths(scaledOne, scaledTwo, false); | 419 drawAsciiPaths(scaledOne, scaledTwo, true); |
| 419 } | 420 } |
| 420 | 421 |
| 421 void ShowTestArray() { | 422 void ShowTestArray() { |
| 422 for (int x = gTestFirst; x < gTestNo; ++x) { | 423 for (int x = gTestFirst; x < gTestNo; ++x) { |
| 423 SkDebugf(" TEST(xOp%d%s),\n", x, opSuffixes[gTestOp[x - gTestFirst]])
; | 424 SkDebugf(" TEST(xOp%d%s),\n", x, opSuffixes[gTestOp[x - gTestFirst]])
; |
| 424 } | 425 } |
| 425 } | 426 } |
| 426 | 427 |
| 427 static int comparePaths(skiatest::Reporter* reporter, const char* testName, cons
t SkPath& one, | 428 static int comparePaths(skiatest::Reporter* reporter, const char* testName, cons
t SkPath& one, |
| 428 const SkPath& scaledOne, const SkPath& two, const SkPath& scaledTwo, SkB
itmap& bitmap, | 429 const SkPath& scaledOne, const SkPath& two, const SkPath& scaledTwo, SkB
itmap& bitmap, |
| (...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 739 if (tests[index].fun == stopTest) { | 740 if (tests[index].fun == stopTest) { |
| 740 SkDebugf("lastTest\n"); | 741 SkDebugf("lastTest\n"); |
| 741 break; | 742 break; |
| 742 } | 743 } |
| 743 if (index == last) { | 744 if (index == last) { |
| 744 break; | 745 break; |
| 745 } | 746 } |
| 746 index += reverse ? -1 : 1; | 747 index += reverse ? -1 : 1; |
| 747 } while (true); | 748 } while (true); |
| 748 } | 749 } |
| OLD | NEW |