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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 int errors2x2; | 282 int errors2x2; |
283 SkPath scaledOne, scaledTwo; | 283 SkPath scaledOne, scaledTwo; |
284 (void) pathsDrawTheSame(one, two, bitmap, scaledOne, scaledTwo, errors2x2); | 284 (void) pathsDrawTheSame(one, two, bitmap, scaledOne, scaledTwo, errors2x2); |
285 if (errors2x2 == 0) { | 285 if (errors2x2 == 0) { |
286 return 0; | 286 return 0; |
287 } | 287 } |
288 const int MAX_ERRORS = 9; | 288 const int MAX_ERRORS = 9; |
289 return errors2x2 > MAX_ERRORS ? errors2x2 : 0; | 289 return errors2x2 > MAX_ERRORS ? errors2x2 : 0; |
290 } | 290 } |
291 | 291 |
292 const int gTestFirst = 4; | 292 const int gTestFirst = 6; |
293 static int gTestNo = gTestFirst; | 293 static int gTestNo = gTestFirst; |
294 static SkTDArray<SkPathOp> gTestOp; | 294 static SkTDArray<SkPathOp> gTestOp; |
295 | 295 |
296 static void showPathOpPath(const char* testName, const SkPath& one, const SkPath
& two, | 296 static void showPathOpPath(const char* testName, const SkPath& one, const SkPath
& two, |
297 const SkPath& a, const SkPath& b, const SkPath& scaledOne, const SkPath&
scaledTwo, | 297 const SkPath& a, const SkPath& b, const SkPath& scaledOne, const SkPath&
scaledTwo, |
298 const SkPathOp shapeOp, const SkMatrix& scale) { | 298 const SkPathOp shapeOp, const SkMatrix& scale) { |
299 SkASSERT((unsigned) shapeOp < SK_ARRAY_COUNT(opStrs)); | 299 SkASSERT((unsigned) shapeOp < SK_ARRAY_COUNT(opStrs)); |
300 if (!testName) { | 300 if (!testName) { |
301 testName = "xOp"; | 301 testName = "xOp"; |
302 } | 302 } |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
647 do { | 647 do { |
648 if (tests[index].fun == skipTest) { | 648 if (tests[index].fun == skipTest) { |
649 foundSkip = true; | 649 foundSkip = true; |
650 } | 650 } |
651 if (foundSkip && tests[index].fun != firstTest) { | 651 if (foundSkip && tests[index].fun != firstTest) { |
652 #if DEBUG_SHOW_TEST_NAME | 652 #if DEBUG_SHOW_TEST_NAME |
653 SkDebugf("\n<div id=\"%s\">\n", tests[index].str); | 653 SkDebugf("\n<div id=\"%s\">\n", tests[index].str); |
654 #endif | 654 #endif |
655 (*tests[index].fun)(reporter, tests[index].str); | 655 (*tests[index].fun)(reporter, tests[index].str); |
656 } | 656 } |
657 if (tests[index].fun == stopTest) { | 657 if (tests[index].fun == stopTest || index == last) { |
658 SkDebugf("lastTest\n"); | |
659 break; | |
660 } | |
661 if (index == last) { | |
662 break; | 658 break; |
663 } | 659 } |
664 index += reverse ? -1 : 1; | 660 index += reverse ? -1 : 1; |
665 } while (true); | 661 } while (true); |
| 662 #if DEBUG_SHOW_TEST_NAME |
| 663 SkDebugf( |
| 664 "\n" |
| 665 "</div>\n" |
| 666 "\n" |
| 667 "<script type=\"text/javascript\">\n" |
| 668 "\n" |
| 669 "var testDivs = [\n" |
| 670 ); |
| 671 index = reverse ? count - 1 : 0; |
| 672 last = reverse ? 0 : count - 1; |
| 673 foundSkip = !skipTest; |
| 674 do { |
| 675 if (tests[index].fun == skipTest) { |
| 676 foundSkip = true; |
| 677 } |
| 678 if (foundSkip && tests[index].fun != firstTest) { |
| 679 SkDebugf(" %s,\n", tests[index].str); |
| 680 } |
| 681 if (tests[index].fun == stopTest || index == last) { |
| 682 break; |
| 683 } |
| 684 index += reverse ? -1 : 1; |
| 685 } while (true); |
| 686 #endif |
666 } | 687 } |
OLD | NEW |