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

Side by Side Diff: tests/PathTest.cpp

Issue 597963002: Fix convexicator bug (Closed) Base URL: https://skia.googlesource.com/skia.git@m38_2125
Patch Set: Created 6 years, 2 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/core/SkPath.cpp ('k') | no next file » | 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 2011 Google Inc. 2 * Copyright 2011 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 "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkPaint.h" 9 #include "SkPaint.h"
10 #include "SkParse.h" 10 #include "SkParse.h"
(...skipping 1177 matching lines...) Expand 10 before | Expand all | Expand 10 after
1188 strokedSin.moveTo(x, y); 1188 strokedSin.moveTo(x, y);
1189 } else { 1189 } else {
1190 strokedSin.lineTo(x, y); 1190 strokedSin.lineTo(x, y);
1191 } 1191 }
1192 } 1192 }
1193 SkStrokeRec stroke(SkStrokeRec::kFill_InitStyle); 1193 SkStrokeRec stroke(SkStrokeRec::kFill_InitStyle);
1194 stroke.setStrokeStyle(2 * SK_Scalar1); 1194 stroke.setStrokeStyle(2 * SK_Scalar1);
1195 stroke.applyToPath(&strokedSin, strokedSin); 1195 stroke.applyToPath(&strokedSin, strokedSin);
1196 check_convexity(reporter, strokedSin, SkPath::kConcave_Convexity); 1196 check_convexity(reporter, strokedSin, SkPath::kConcave_Convexity);
1197 check_direction(reporter, strokedSin, kDontCheckDir); 1197 check_direction(reporter, strokedSin, kDontCheckDir);
1198
1199 // http://crbug.com/412640
1200 SkPath degenerateConcave;
1201 degenerateConcave.moveTo(148.67912f, 191.875f);
1202 degenerateConcave.lineTo(470.37695f, 7.5f);
1203 degenerateConcave.lineTo(148.67912f, 191.875f);
1204 degenerateConcave.lineTo(41.446522f, 376.25f);
1205 degenerateConcave.lineTo(-55.971577f, 460.0f);
1206 degenerateConcave.lineTo(41.446522f, 376.25f);
1207 check_convexity(reporter, degenerateConcave, SkPath::kConcave_Convexity);
1208 check_direction(reporter, degenerateConcave, SkPath::kUnknown_Direction);
1198 } 1209 }
1199 1210
1200 static void check_convex_bounds(skiatest::Reporter* reporter, const SkPath& p, 1211 static void check_convex_bounds(skiatest::Reporter* reporter, const SkPath& p,
1201 const SkRect& bounds) { 1212 const SkRect& bounds) {
1202 REPORTER_ASSERT(reporter, p.isConvex()); 1213 REPORTER_ASSERT(reporter, p.isConvex());
1203 REPORTER_ASSERT(reporter, p.getBounds() == bounds); 1214 REPORTER_ASSERT(reporter, p.getBounds() == bounds);
1204 1215
1205 SkPath p2(p); 1216 SkPath p2(p);
1206 REPORTER_ASSERT(reporter, p2.isConvex()); 1217 REPORTER_ASSERT(reporter, p2.isConvex());
1207 REPORTER_ASSERT(reporter, p2.getBounds() == bounds); 1218 REPORTER_ASSERT(reporter, p2.getBounds() == bounds);
(...skipping 2366 matching lines...) Expand 10 before | Expand all | Expand 10 after
3574 test_addEmptyPath(reporter, SkPath::kExtend_AddPathMode); 3585 test_addEmptyPath(reporter, SkPath::kExtend_AddPathMode);
3575 test_addEmptyPath(reporter, SkPath::kAppend_AddPathMode); 3586 test_addEmptyPath(reporter, SkPath::kAppend_AddPathMode);
3576 test_conicTo_special_case(reporter); 3587 test_conicTo_special_case(reporter);
3577 test_get_point(reporter); 3588 test_get_point(reporter);
3578 test_contains(reporter); 3589 test_contains(reporter);
3579 PathTest_Private::TestPathTo(reporter); 3590 PathTest_Private::TestPathTo(reporter);
3580 PathRefTest_Private::TestPathRef(reporter); 3591 PathRefTest_Private::TestPathRef(reporter);
3581 test_dump(reporter); 3592 test_dump(reporter);
3582 test_path_crbugskia2820(reporter); 3593 test_path_crbugskia2820(reporter);
3583 } 3594 }
OLDNEW
« no previous file with comments | « src/core/SkPath.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698