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

Unified Diff: tests/PathTest.cpp

Issue 298973004: In convexity checker don't advance last vector when x-product isn't significant. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: remove debugging code Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkPath.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PathTest.cpp
diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp
index 3de10cb10642696b504ee605f6299520ee2edbd4..e265d317cadd87d0cad7a047576036cc2c036042 100644
--- a/tests/PathTest.cpp
+++ b/tests/PathTest.cpp
@@ -1151,6 +1151,23 @@ static void test_convexity2(skiatest::Reporter* reporter) {
dent.close();
check_convexity(reporter, dent, SkPath::kConcave_Convexity);
check_direction(reporter, dent, SkPath::kCW_Direction);
+
+ // http://skbug.com/2235
+ SkPath strokedSin;
+ for (int i = 0; i < 2000; i++) {
+ SkScalar x = SkIntToScalar(i) / 2;
+ SkScalar y = 500 - (x + SkScalarSin(x / 100) * 40) / 3;
+ if (0 == i) {
+ strokedSin.moveTo(x, y);
+ } else {
+ strokedSin.lineTo(x, y);
+ }
+ }
+ SkStrokeRec stroke(SkStrokeRec::kFill_InitStyle);
+ stroke.setStrokeStyle(2 * SK_Scalar1);
+ stroke.applyToPath(&strokedSin, strokedSin);
+ check_convexity(reporter, strokedSin, SkPath::kConcave_Convexity);
+ check_direction(reporter, strokedSin, kDontCheckDir);
}
static void check_convex_bounds(skiatest::Reporter* reporter, const SkPath& p,
« 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