aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/PathMeasureTest.cpp
diff options
context:
space:
mode:
authorGravatar Mike Reed <reed@google.com>2018-03-16 10:15:43 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-16 15:11:31 +0000
commit473f69276f1854db80e094cc4af091f7f8a5b00b (patch)
treef23829b7ff2dd37fe80018c6dfa5d83a05bd3d48 /tests/PathMeasureTest.cpp
parente464160f6969d28d0e8c76c493f325e3a716c4d2 (diff)
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 <caryclark@google.com> Commit-Queue: Mike Reed <reed@google.com>
Diffstat (limited to 'tests/PathMeasureTest.cpp')
-rw-r--r--tests/PathMeasureTest.cpp10
1 files changed, 10 insertions, 0 deletions
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());
+}