OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |