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

Side by Side Diff: tests/PathOpsExtendedTest.cpp

Issue 1140813002: deal more consistently with unsortable edges (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix linux warning Created 5 years, 7 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/SkPathOpsOp.cpp ('k') | tests/PathOpsOpTest.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 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 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 SK_DECLARE_STATIC_MUTEX(compareDebugOut3); 324 SK_DECLARE_STATIC_MUTEX(compareDebugOut3);
325 SK_DECLARE_STATIC_MUTEX(compareDebugOut4); 325 SK_DECLARE_STATIC_MUTEX(compareDebugOut4);
326 static int comparePaths(skiatest::Reporter* reporter, const char* testName, cons t SkPath& one, 326 static int comparePaths(skiatest::Reporter* reporter, const char* testName, cons t SkPath& one,
327 const SkPath& scaledOne, const SkPath& two, const SkPath& scaledTwo, SkB itmap& bitmap, 327 const SkPath& scaledOne, const SkPath& two, const SkPath& scaledTwo, SkB itmap& bitmap,
328 const SkPath& a, const SkPath& b, const SkPathOp shapeOp, const SkMatrix & scale, 328 const SkPath& a, const SkPath& b, const SkPathOp shapeOp, const SkMatrix & scale,
329 bool expectSuccess, bool flaky) { 329 bool expectSuccess, bool flaky) {
330 int errors2x2; 330 int errors2x2;
331 const int MAX_ERRORS = 8; 331 const int MAX_ERRORS = 8;
332 (void) pathsDrawTheSame(bitmap, scaledOne, scaledTwo, errors2x2); 332 (void) pathsDrawTheSame(bitmap, scaledOne, scaledTwo, errors2x2);
333 if (!expectSuccess) { 333 if (!expectSuccess) {
334 if (errors2x2 <= MAX_ERRORS) { 334 if (errors2x2 <= MAX_ERRORS && !flaky) {
335 REPORTER_ASSERT(reporter, 0); 335 REPORTER_ASSERT(reporter, 0);
336 } 336 }
337 return 0; 337 return 0;
338 } 338 }
339 if (errors2x2 == 0) { 339 if (errors2x2 == 0) {
340 return 0; 340 return 0;
341 } 341 }
342 if (flaky) { 342 if (flaky) {
343 return 0; 343 return 0;
344 } 344 }
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 return innerPathOp(reporter, a, b, shapeOp, testName, false, true, true); 552 return innerPathOp(reporter, a, b, shapeOp, testName, false, true, true);
553 } 553 }
554 554
555 bool testPathOpCheck(skiatest::Reporter* reporter, const SkPath& a, const SkPath & b, 555 bool testPathOpCheck(skiatest::Reporter* reporter, const SkPath& a, const SkPath & b,
556 const SkPathOp shapeOp, const char* testName, bool checkFail) { 556 const SkPathOp shapeOp, const char* testName, bool checkFail) {
557 return innerPathOp(reporter, a, b, shapeOp, testName, false, checkFail, fals e); 557 return innerPathOp(reporter, a, b, shapeOp, testName, false, checkFail, fals e);
558 } 558 }
559 559
560 bool testPathOpFailCheck(skiatest::Reporter* reporter, const SkPath& a, const Sk Path& b, 560 bool testPathOpFailCheck(skiatest::Reporter* reporter, const SkPath& a, const Sk Path& b,
561 const SkPathOp shapeOp, const char* testName) { 561 const SkPathOp shapeOp, const char* testName) {
562 return innerPathOp(reporter, a, b, shapeOp, testName, false, false, false); 562 return innerPathOp(reporter, a, b, shapeOp, testName, false, false, true);
563 } 563 }
564 564
565 bool testPathFailOp(skiatest::Reporter* reporter, const SkPath& a, const SkPath& b, 565 bool testPathFailOp(skiatest::Reporter* reporter, const SkPath& a, const SkPath& b,
566 const SkPathOp shapeOp, const char* testName) { 566 const SkPathOp shapeOp, const char* testName) {
567 #if DEBUG_SHOW_TEST_NAME 567 #if DEBUG_SHOW_TEST_NAME
568 showName(a, b, shapeOp); 568 showName(a, b, shapeOp);
569 #endif 569 #endif
570 SkPath orig; 570 SkPath orig;
571 orig.lineTo(54, 43); 571 orig.lineTo(54, 43);
572 SkPath out = orig; 572 SkPath out = orig;
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 if (foundSkip && tests[index].fun != firstTest) { 687 if (foundSkip && tests[index].fun != firstTest) {
688 SkDebugf(" %s,\n", tests[index].str); 688 SkDebugf(" %s,\n", tests[index].str);
689 } 689 }
690 if (tests[index].fun == stopTest || index == last) { 690 if (tests[index].fun == stopTest || index == last) {
691 break; 691 break;
692 } 692 }
693 index += reverse ? -1 : 1; 693 index += reverse ? -1 : 1;
694 } while (true); 694 } while (true);
695 #endif 695 #endif
696 } 696 }
OLDNEW
« no previous file with comments | « src/pathops/SkPathOpsOp.cpp ('k') | tests/PathOpsOpTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698