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

Unified Diff: tests/PathTest.cpp

Issue 954453003: Reset conicWeights in SkPath::consumeDegenerateSegments when rewinding to last Move op (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Added unit test Created 5 years, 10 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 7db65a899f24f310dc8e1232a97ff6fb7d4f7352..a868d93d78c3c6e740f548dae88377ee47bc9ddd 100644
--- a/tests/PathTest.cpp
+++ b/tests/PathTest.cpp
@@ -2475,6 +2475,20 @@ static void test_iter(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter, SkPath::kDone_Verb == iter.next(pts, true));
// The GM degeneratesegments.cpp test is more extensive
+
+ // Test out mixed degenerate and non-degenerate geometry with Conics
+ const SkVector radii[4] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 100, 100 } };
+ SkRect r = SkRect::MakeWH(100, 100);
+ SkRRect rr;
+ rr.setRectRadii(r, radii);
+ p.reset();
+ p.addRRect(rr);
+ iter.setPath(p, false);
+ REPORTER_ASSERT(reporter, SkPath::kMove_Verb == iter.next(pts));
+ REPORTER_ASSERT(reporter, SkPath::kLine_Verb == iter.next(pts));
+ REPORTER_ASSERT(reporter, SkPath::kLine_Verb == iter.next(pts));
+ REPORTER_ASSERT(reporter, SkPath::kConic_Verb == iter.next(pts));
robertphillips 2015/02/23 18:53:47 This next line will trigger a valgrind complaint w
+ REPORTER_ASSERT(reporter, SK_ScalarRoot2Over2 == iter.conicWeight());
}
static void test_raw_iter(skiatest::Reporter* reporter) {
« 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