Go to file
Stephen White c4dbc3758f GrTessellator: improved straight skeleton implementation.
This patch improves the straight skeleton implementation used by
GrTessellator to collapse overlap regions in the alpha gradient border.
The resulting quality improvement can be seen in the
"thinconcavepaths" GM, for example, where the coverage values of
the "thin right angle", "thin rect and triangle" and "skinny snake"
are now lower and match the raster backend more closely. It also improves
correctness, such as on the linked Chromium bugs below.

Previously, the straight skeleton was performed using the same Vertex
and Edge classes used for tessellation, but this led to fragility in
maintaining the connectivity and ordering required by those classes.
Instead, that functionality has been moved to new SSEdge and SSVertex
classes. Their construction results in alternating SSVertex and
SSEdges around the boundary of the each overlap region, shrunk by one
SSEdge as the boundary collapses.

Applying events may now also create further events (chained events),
as intersections between newly-adjacent bisectors change the structure
of the skeleton. This is always calculated from the bisectors of
original boundary, not the shrunk boundary of the straight skeleton,
which is why each SSEdge points at its originating Edge. If the edges
are parallel or near-parallel, the bisector may be infinite. This is
handled by a new flavour of create_event(), which does a Line/Line
intersection (rather than an Edge/Edge intersection) to find the
intersection between the infinite bisector and an adjacent bisector.

Several ancillary bugs were fixed: the priority queue used to represent
edge events was sorting the inner edges incorrectly. These need to be
sorted in descending not ascending order of coverage. Its implementation
was moved from Skia's TDPQueue to std::priority_queue(), which is more
flexible in specifying a comparator.

check_for_intersection()'s partner synthesis code was moved into a new
function, compute_bisector(), also used by the chained skeleton events
code.

Degenerate edges are now removed during the simplify_boundary() pass.
They were previously detected but ignored, causing incorrect inner and
outer tangents to be computed in stroke_boundary().

An fSynthetic flag was added to Vertex, in order to detect vertices
which cannot be moved by an edge collapse event (e.g., intersections
with non-boundary edges, merged vertices, straight skeleton vertices).

More raw implementation notes:
Connect straight skeleton vertices as we find them, so we don't
have to use partnering (ss_connect()).
Only disconnect edges which are still alive after event application.
Add a check for near-parallel lines in compute_bisector().
Don't use edge type to determine direction to offset for bisectors.
The winding should already include this information.
Move Event ownership to SSEdge.
If we're down to the last two edges in a skeleton, don't check for events.
Add concave_arc_and_circle GM.
Add a collapsepaths GM.

Bug: 941429, 913349, 929915, 945853

Change-Id: Ib89e231d0e8611f8735fd3592db6391da096369d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215094
Commit-Queue: Stephen White <senorblanco@chromium.org>
Reviewed-by: Robert Phillips <robertphillips@google.com>
2019-05-22 16:16:59 +00:00
animations first cut at a checkbox 2009-10-21 19:41:10 +00:00
bench Move SkLeanWindows.h to src. 2019-05-21 13:48:00 +00:00
bin SkQP: new docker test code 2019-04-19 18:50:03 +00:00
dm Move SkLeanWindows.h to src. 2019-05-21 13:48:00 +00:00
docker Include wasm debugger in continuous build part 2 2019-04-01 19:51:43 +00:00
docs/examples Use SkTextEncoding enum instead of macros. 2019-05-07 20:54:16 +00:00
example Use SkTextEncoding enum instead of macros. 2019-05-07 20:54:16 +00:00
experimental update SkUserConfig.h a bit 2019-05-20 17:52:22 +00:00
fuzz Use SkFontHinting instead of macros. 2019-05-08 12:16:37 +00:00
gm GrTessellator: improved straight skeleton implementation. 2019-05-22 16:16:59 +00:00
gn GrTessellator: improved straight skeleton implementation. 2019-05-22 16:16:59 +00:00
include Move SkLeanWindows.h to src. 2019-05-21 13:48:00 +00:00
infra Add Huawei P30 to the tree. 2019-05-22 12:26:29 +00:00
modules simplify setColor, without needing the 4f or the colorspace 2019-05-20 16:59:26 +00:00
platform_tools rewrite includes to not need so much -Ifoo 2019-04-24 16:27:11 +00:00
resources Initial version of rescaling async readback API 2019-05-17 16:39:10 +00:00
samplecode Remove Nima from DEPS, experiments, Viewer, etc. 2019-05-16 17:02:11 +00:00
site rewrite docs to explicitly use python2 2019-05-13 19:21:47 +00:00
specs [img-decode] Start on proposed new spec 2019-05-06 17:39:19 +00:00
src GrTessellator: improved straight skeleton implementation. 2019-05-22 16:16:59 +00:00
tests Remove VisitorType from GrOp::visitProxies 2019-05-22 15:13:50 +00:00
third_party Remove Nima from DEPS, experiments, Viewer, etc. 2019-05-16 17:02:11 +00:00
tools Fix resize and vsync issues in Mac Viewer 2019-05-22 14:54:20 +00:00
.clang-format restore .clang-format 2019-03-21 15:52:32 +00:00
.clang-tidy add google-build-namespaces to clang-tidy checks 2018-12-12 16:33:59 +00:00
.gitignore clean up some .gitignores 2019-05-15 19:55:45 +00:00
.gn Basic standalone GN configs. 2016-07-21 12:25:45 -07:00
AUTHORS Fix use of 'is' operator for comparison 2019-05-07 14:22:15 +00:00
BUILD.gn Revert "Revert "Experimental SkVideoDecoder, to wrap calls to ffmpeg"" 2019-05-17 21:25:48 +00:00
codereview.settings Make uploading to Gerrit the default for Skia 2016-11-09 19:07:56 +00:00
CONTRIBUTING Fix references to https://sites.google.com/site/skiadocs/. 2015-02-03 13:12:54 -02:00
CQ_COMMITTERS Moved committer list to chrome-infra-auth and deleted it from the repo 2015-09-02 13:37:54 -07:00
DEPS Roll third_party/externals/angle2 e8247a574956..fb8e1b25ad71 (6 commits) 2019-05-22 05:29:23 +00:00
go.mod [infra] Pin infra code using Go modules 2019-05-06 17:53:19 +00:00
go.sum [infra] Pin infra code using Go modules 2019-05-06 17:53:19 +00:00
LICENSE BUG=skia:5602 2016-09-02 11:19:34 -07:00
OWNERS add OWNERS file 2017-12-01 19:50:19 +00:00
PRESUBMIT.py add mtklein to api approvals 2019-04-02 15:16:56 +00:00
public.bzl Revert "Revert "Experimental SkVideoDecoder, to wrap calls to ffmpeg"" 2019-05-17 21:25:48 +00:00
README Fix references to https://sites.google.com/site/skiadocs/. 2015-02-03 13:12:54 -02:00
README.chromium Update README.chromium. 2015-06-11 13:19:24 -07:00
whitespace.txt Whitespace test 2019-05-18 13:05:29 +00:00

Skia is a complete 2D graphic library for drawing Text, Geometries, and Images.

See full details, and build instructions, at https://skia.org.