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

Side by Side Diff: tests/PathOpsBuilderTest.cpp

Issue 1129863007: look for deleted pts when detecting line/curve coincident edges (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix path op builder 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/SkPathOpsDebug.cpp ('k') | tests/PathOpsIssue3651.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 2014 Google Inc. 2 * Copyright 2014 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 "PathOpsTestCommon.h" 9 #include "PathOpsTestCommon.h"
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 Op(circle1, circle2, kUnion_SkPathOp, &opCompare); 71 Op(circle1, circle2, kUnion_SkPathOp, &opCompare);
72 Op(opCompare, circle3, kDifference_SkPathOp, &opCompare); 72 Op(opCompare, circle3, kDifference_SkPathOp, &opCompare);
73 builder.add(circle1, kUnion_SkPathOp); 73 builder.add(circle1, kUnion_SkPathOp);
74 builder.add(circle2, kUnion_SkPathOp); 74 builder.add(circle2, kUnion_SkPathOp);
75 builder.add(circle3, kDifference_SkPathOp); 75 builder.add(circle3, kDifference_SkPathOp);
76 REPORTER_ASSERT(reporter, builder.resolve(&result)); 76 REPORTER_ASSERT(reporter, builder.resolve(&result));
77 SkBitmap bitmap; 77 SkBitmap bitmap;
78 int pixelDiff = comparePaths(reporter, __FUNCTION__, opCompare, result, bitm ap); 78 int pixelDiff = comparePaths(reporter, __FUNCTION__, opCompare, result, bitm ap);
79 REPORTER_ASSERT(reporter, pixelDiff == 0); 79 REPORTER_ASSERT(reporter, pixelDiff == 0);
80 } 80 }
81
82 DEF_TEST(Issue3838, reporter) {
83 SkPath path;
84 path.moveTo(200, 170);
85 path.lineTo(220, 170);
86 path.lineTo(220, 230);
87 path.lineTo(240, 230);
88 path.lineTo(240, 210);
89 path.lineTo(180, 210);
90 path.lineTo(180, 190);
91 path.lineTo(260, 190);
92 path.lineTo(260, 250);
93 path.lineTo(200, 250);
94 path.lineTo(200, 170);
95 path.close();
96 testSimplify(reporter, path, __FUNCTION__);
97 SkPath path3;
98 Simplify(path, &path3);
99 SkPath path2;
100 SkOpBuilder builder;
101 builder.add(path, kUnion_SkPathOp);
102 builder.resolve(&path2);
103 SkBitmap bitmap;
104 int pixelDiff = comparePaths(reporter, __FUNCTION__, path, path2, bitmap);
105 REPORTER_ASSERT(reporter, pixelDiff == 0);
106 }
OLDNEW
« no previous file with comments | « src/pathops/SkPathOpsDebug.cpp ('k') | tests/PathOpsIssue3651.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698