9f73b04b43
Convexity is determined with a two pass algorithm, first by a sign measure and then by a winding measure. Convexity also is meant to not be affected by leading moveTos (other than the last leading moveTo before real verbs) and not affected by trailing moveTos (since no additional contour has actually started). The old code would incorrectly reduce pointCount when the last moveTo index was greater than 0, so the BySign pass was skipped or calculated on an incomplete set of points. When a path (as the one added in this CL's new test) is convex by winding but not by sign, it would be incorrectly identified as convex. This led to further cascading issues during rasterization. However, the old code also had the effect of correctly ignoring any last trailing moveTo from being included in the BySign test. Without the new loop decrementing pointCount, trailing moveTo locations would incorrectly create concave paths (and would in fact be concave if the verb was anything other than a move). I also realized that if the last moveTo index is not at the end of the initial leading block, or at the end of the path entirely, then it means the path must have multiple contours, at which point the path cannot be convex, so we take the early out. TBR: reed@google.com, bsalomon@google.com Bug: skia:1220754 Change-Id: I9bd38f2eaaa3dbee135c190ade46fce0bd20257a Reviewed-on: https://skia-review.googlesource.com/c/skia/+/420238 Reviewed-by: Michael Ludwig <michaelludwig@google.com> Commit-Queue: Michael Ludwig <michaelludwig@google.com> |
||
---|---|---|
animations | ||
bazel | ||
bench | ||
bin | ||
build/fuchsia | ||
build_overrides | ||
client_utils/android | ||
demos.skia.org | ||
dm | ||
docker | ||
docs/examples | ||
example | ||
experimental | ||
fuzz | ||
gm | ||
gn | ||
include | ||
infra | ||
modules | ||
platform_tools | ||
resources | ||
samplecode | ||
site | ||
specs | ||
src | ||
tests | ||
third_party | ||
tools | ||
.bazelignore | ||
.clang-format | ||
.clang-tidy | ||
.gitignore | ||
.gn | ||
AUTHORS | ||
BUILD.bazel | ||
BUILD.gn | ||
codereview.settings | ||
CONTRIBUTING | ||
CQ_COMMITTERS | ||
DEPS | ||
DIR_METADATA | ||
go.mod | ||
go.sum | ||
LICENSE | ||
PRESUBMIT.py | ||
public.bzl | ||
README | ||
README.chromium | ||
RELEASE_NOTES.txt | ||
whitespace.txt | ||
WORKSPACE.bazel |
Skia is a complete 2D graphic library for drawing Text, Geometries, and Images. See full details, and build instructions, at https://skia.org.