aboutsummaryrefslogtreecommitdiffhomepage
path: root/platform_tools
diff options
context:
space:
mode:
authorGravatar senorblanco <senorblanco@chromium.org>2016-06-02 11:36:48 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-06-02 11:36:48 -0700
commit531237ef3aaf0d3c86e0853fde3b4c8f517bc662 (patch)
tree745951eb5df91570df69d268c39a6b958cccc8e6 /platform_tools
parentf2204c93b59831b52cde52e5a340fe0dcffd2b93 (diff)
Tessellator: stop copying vertices into Polys and Monotones.
The vertices which are produced by stage 5 of the tesselator are copied into the Polys and MonotonePolys it produces. This is necessary because each vertex may have an arbitrary valence, since it may participate in an arbitrary number of Polys, so we can't use the vertex's prev/next pointers to represent all the Monotones of which this vertex may be a member. However, each Edge can only be a member of two Polys (one on each side of the edge). So by adding two prev/next pointer pairs to each Edge, we can represent each Monotone as a list of edges instead. Then we no longer need to copy the vertices. One wrinkle is that the ear-clipping stage (6) of the tessellator does require prev/next pointers, in order to remove vertices as their ears are clipped. So we convert the edge list into a vertex list during Monotone::emit(), using the prev/next pointers temporarily for that monotone. This change improves performance by 7-20% on a non-caching version of the tessellator, and reduces memory use. Other notes: 1) Polys are initially constructed empty (no edges), but with the top vertex, which is needed for splitting Polys. Edges are added to Polys only after their bottom vertex is seen. 2) MonotonePolys are always constructed with one edge, so we always know their handedness (left/right). MonotonePoly::addEdge() no longer detects when a monotone is "done" (edge of opposite handedness); this is handled by Poly::addEdge(), so MonotonePoly::addEdge() has no return value. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2029243002 Review-Url: https://codereview.chromium.org/2029243002
Diffstat (limited to 'platform_tools')
0 files changed, 0 insertions, 0 deletions