Go to file
Stephen White 3b5a3fa8b1 GrTessellator: implement out-of-range splitting and AEL rewinding.
Due to floating point inaccuracy, when intersecting edges, the
intersection point may fall above one of the edges' top vertices
or below one of the bottom vertices.  In these cases, we were simply
splitting one edge on the relevant endpoint of the other edge. This
is incorrect if the intersection is far from the endpoint (e.g.,
the test case in the linked bug, where one of the intersected edges
is near-horizontal but the intersection falls below both of its
endpoints, in the middle of the edge.)

The correct solution is to split both edges as normal, and take care
to produce edges with the correct ordering where the intersection is
above or below an edge. However, since the new vertex may be above
the current vertex, simply restarting intersection checks at the
current vertex won't work. We need to process the intersection
vertex before the current one.

This introduces another problem: unlike all other splitting modes
(which always shorten edges), splitting an edge above the top or 
below the bottom can lengthen it, causing it to violate the AEL 
with an adjacent edge which then shortens it back to the original 
point (in cleanup_active_edges()). Since the splitting and merging 
code can't agree, we loop forever.

Instead of simply fusing neighboring edges in cleanup_active_edges(), 
the proper fix to this problem is to detect the AEL violation and 
rewind all processing to the vertex above it. For performance, we 
only rewind when we detect that a split edge is no longer ordered 
within the mesh (merge_enclosing_edges()) or within the the AEL 
(rewind_if_necessary()).  We also store the enclosing edges of each 
vertex, which allows us to rewind quickly, since we know exactly which 
edges need to be added/removed from the AEL.

cleanup_active_edges(), fix_active_state() and Vertex::fProcessed have
been removed. In their place are rewind_active_edges() and 
rewind_if_necessary(), which uses the same logic as 
cleanup_active_edges() but uses it to know when to rewind.

Bug: skia:5026
Change-Id: I3638a429f5428498d6df6bb7b98c67374dc291aa
Reviewed-on: https://skia-review.googlesource.com/18900
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
2017-06-07 00:09:15 +00:00
animations first cut at a checkbox 2009-10-21 19:41:10 +00:00
bench add testing flag to force rasterpipeline 2017-06-05 14:45:11 +00:00
bin bin/fetch-clang-format 2017-03-08 16:43:49 +00:00
debugger Get Debugger app compiling again 2017-01-06 16:18:27 +00:00
dm Remove ImmediateFlush mode 2017-06-02 17:35:18 +00:00
example Revert "Revert "Plumb the use of GrBackendRenderTarget throughout Skia"" 2017-05-01 14:14:50 +00:00
experimental move perlinenoise2 into effects 2017-05-30 20:15:37 +00:00
fuzz Revert "Revert "Delete SkGaussianEdgeShader"" 2017-05-31 14:52:12 +00:00
gm GrTessellator: implement out-of-range splitting and AEL rewinding. 2017-06-07 00:09:15 +00:00
gn move Coeff into blendmode 2017-06-06 15:07:00 +00:00
include Create an SkColorSpaceXform image generator 2017-06-06 14:34:03 +00:00
infra Roll recipe dependencies (trivial). 2017-06-06 18:15:40 +00:00
platform_tools Enable ios on Raspberry Pi 2017-04-25 16:56:41 +00:00
resources Defend against ICOs with large BMPs embedded 2017-06-05 18:28:19 +00:00
samplecode Add TiledDrawScheduler so we can concurrently draw and enque 2017-06-05 19:29:57 +00:00
site Update link to testing infrastructure. 2017-06-05 18:20:55 +00:00
src GrTessellator: implement out-of-range splitting and AEL rewinding. 2017-06-07 00:09:15 +00:00
tests Fix GrReducedClip.cpp: assertion failure surrounding tiny query bounds 2017-06-05 19:53:06 +00:00
third_party Roll ANGLE 2017-06-02 18:36:15 +00:00
tools Revert "Revert "Workaround Adreno driver issue with stencil clears."" 2017-06-06 23:32:28 +00:00
.clang-format Mark flatennable macros as block beginning/ending in .clang-format 2017-01-09 15:31:36 +00:00
.gitignore Refactor Vulkan support to support Fuchsia 2017-04-05 17:32:09 +00:00
.gn Basic standalone GN configs. 2016-07-21 12:25:45 -07:00
AUTHORS Added support for building for tvOS 2017-03-14 22:55:04 +00:00
BUILD.gn Replace BMP calls to new with calls to malloc 2017-06-05 15:09:40 +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 ANGLE DEPS 2017-06-05 12:52:31 +00:00
Doxyfile Make the housekeeper upload doxygen to a newer bucket 2016-10-04 13:23:57 -07:00
LICENSE BUG=skia:5602 2016-09-02 11:19:34 -07:00
PRESUBMIT.py Use Gerrit style format for footers in Presubmit 2017-05-23 20:44:36 +00:00
public.bzl more exclusion of SkImageEncoder_none.cpp 2017-06-06 19:47:03 +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 Marker for Win AMD driver update. 2017-05-22 17:21:14 +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.