From 140ab3659e0c5193c778c5e2752387cd0fbe370c Mon Sep 17 00:00:00 2001 From: Mike Reed Date: Tue, 20 Mar 2018 16:47:32 +0000 Subject: Reland "fix nextContour bug" This reverts commit 0a86820f2fe3b62f2a5ac2917a1ef342dbe53722. Reason for revert: fix has landed in CTS Original change's description: > Revert "fix nextContour bug" > > This reverts commit 473f69276f1854db80e094cc4af091f7f8a5b00b. > > Reason for revert: a CTS test PathMeasureTest.android.graphics.cts.PathMeasureTest.testNextContour is failing > > Original change's description: > > fix nextContour bug > > > > Calling nextContour() needs to ensure that we've already measured the "current" one. > > > > Bug: skia: > > Change-Id: I501c26d0b068028d67103888f06ec89125a5407a > > Reviewed-on: https://skia-review.googlesource.com/114692 > > Reviewed-by: Cary Clark > > Commit-Queue: Mike Reed > > TBR=caryclark@google.com,reed@google.com > > Change-Id: I7f1e08651dfe73c02158b209dc28af2b174e246f > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia: > Reviewed-on: https://skia-review.googlesource.com/114823 > Reviewed-by: Stan Iliev > Commit-Queue: Stan Iliev TBR=caryclark@google.com,reed@google.com,stani@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: skia: Change-Id: I0fd61473ef0df62722cf6c6b86f1277f580e4ab1 Reviewed-on: https://skia-review.googlesource.com/115340 Reviewed-by: Mike Reed Commit-Queue: Mike Reed --- tests/PathMeasureTest.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'tests/PathMeasureTest.cpp') diff --git a/tests/PathMeasureTest.cpp b/tests/PathMeasureTest.cpp index df66578f1b..bc75c5f122 100644 --- a/tests/PathMeasureTest.cpp +++ b/tests/PathMeasureTest.cpp @@ -217,3 +217,13 @@ DEF_TEST(PathMeasureConic, reporter) { REPORTER_ASSERT(reporter, 19.5f < stdP.fX && stdP.fX < 20.5f); REPORTER_ASSERT(reporter, 19.5f < hiP.fX && hiP.fX < 20.5f); } + +// Regression test for b/26425223 +DEF_TEST(PathMeasure_nextctr, reporter) { + SkPath path; + path.moveTo(0, 0); path.lineTo(100, 0); + + SkPathMeasure meas(path, false); + // only expect 1 contour, even if we didn't explicitly call getLength() ourselves + REPORTER_ASSERT(reporter, !meas.nextContour()); +} -- cgit v1.2.3