diff options
author | Mike Reed <reed@google.com> | 2018-03-16 10:15:43 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-03-16 15:11:31 +0000 |
commit | 473f69276f1854db80e094cc4af091f7f8a5b00b (patch) | |
tree | f23829b7ff2dd37fe80018c6dfa5d83a05bd3d48 /src | |
parent | e464160f6969d28d0e8c76c493f325e3a716c4d2 (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 'src')
-rw-r--r-- | src/core/SkPathMeasure.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/SkPathMeasure.cpp b/src/core/SkPathMeasure.cpp index cdcd164018..4fb18934d9 100644 --- a/src/core/SkPathMeasure.cpp +++ b/src/core/SkPathMeasure.cpp @@ -667,7 +667,7 @@ bool SkPathMeasure::getSegment(SkScalar startD, SkScalar stopD, SkPath* dst, } bool SkPathMeasure::isClosed() { - (void)this->getLength(); + (void)this->getLength(); // make sure we measure the current contour return fIsClosed; } @@ -675,7 +675,8 @@ bool SkPathMeasure::isClosed() { we're done with the path. */ bool SkPathMeasure::nextContour() { - fLength = -1; + (void)this->getLength(); // make sure we measure the current contour + fLength = -1; // now signal that we should build the next set of segments return this->getLength() > 0; } |