Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(563)

Issue 2029243002: Tessellator: stop copying vertices into Polys and Monotones. (Closed)

Created:
4 years, 6 months ago by Stephen White
Modified:
4 years, 6 months ago
Reviewers:
robertphillips
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

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 Committed: https://skia.googlesource.com/skia/+/531237ef3aaf0d3c86e0853fde3b4c8f517bc662

Patch Set 1 #

Total comments: 3

Patch Set 2 : Simpler change, with GM #

Patch Set 3 : Fix logging msg #

Patch Set 4 : Fix 100-col issues #

Total comments: 2

Patch Set 5 : Fix style per review #

Unified diffs Side-by-side diffs Delta from patch set Stats (+108 lines, -78 lines) Patch
M gm/concavepaths.cpp View 1 2 chunks +21 lines, -0 lines 0 comments Download
M src/gpu/GrTessellator.cpp View 1 2 3 4 10 chunks +87 lines, -78 lines 0 comments Download

Messages

Total messages: 28 (14 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2029243002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2029243002/1
4 years, 6 months ago (2016-06-01 20:48:32 UTC) #3
Stephen White
Rob: PTAL. Thanks!
4 years, 6 months ago (2016-06-01 21:03:04 UTC) #7
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 6 months ago (2016-06-01 21:05:39 UTC) #9
robertphillips
lgtm (as far as I understand it all) https://codereview.chromium.org/2029243002/diff/1/src/gpu/GrTessellator.cpp File src/gpu/GrTessellator.cpp (right): https://codereview.chromium.org/2029243002/diff/1/src/gpu/GrTessellator.cpp#newcode415 src/gpu/GrTessellator.cpp:415: e->fBottom->fPoint.fX, ...
4 years, 6 months ago (2016-06-02 12:19:48 UTC) #10
Stephen White
https://codereview.chromium.org/2029243002/diff/1/src/gpu/GrTessellator.cpp File src/gpu/GrTessellator.cpp (right): https://codereview.chromium.org/2029243002/diff/1/src/gpu/GrTessellator.cpp#newcode415 src/gpu/GrTessellator.cpp:415: e->fBottom->fPoint.fX, e->fBottom->fPoint.fY, On 2016/06/02 12:19:48, robertphillips wrote: > Does ...
4 years, 6 months ago (2016-06-02 18:01:21 UTC) #11
Stephen White
It turns out this CL had a bug which was not caught by existing GMs. ...
4 years, 6 months ago (2016-06-02 18:02:56 UTC) #12
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2029243002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2029243002/40001
4 years, 6 months ago (2016-06-02 18:03:13 UTC) #14
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2029243002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2029243002/60001
4 years, 6 months ago (2016-06-02 18:07:53 UTC) #17
robertphillips
lgtm https://codereview.chromium.org/2029243002/diff/60001/src/gpu/GrTessellator.cpp File src/gpu/GrTessellator.cpp (right): https://codereview.chromium.org/2029243002/diff/60001/src/gpu/GrTessellator.cpp#newcode349 src/gpu/GrTessellator.cpp:349: , fNext(nullptr) { this-> ?
4 years, 6 months ago (2016-06-02 18:12:02 UTC) #18
Stephen White
https://codereview.chromium.org/2029243002/diff/60001/src/gpu/GrTessellator.cpp File src/gpu/GrTessellator.cpp (right): https://codereview.chromium.org/2029243002/diff/60001/src/gpu/GrTessellator.cpp#newcode349 src/gpu/GrTessellator.cpp:349: , fNext(nullptr) { On 2016/06/02 18:12:02, robertphillips wrote: > ...
4 years, 6 months ago (2016-06-02 18:18:47 UTC) #19
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2029243002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2029243002/80001
4 years, 6 months ago (2016-06-02 18:19:33 UTC) #21
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 6 months ago (2016-06-02 18:34:27 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2029243002/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2029243002/80001
4 years, 6 months ago (2016-06-02 18:35:55 UTC) #26
commit-bot: I haz the power
4 years, 6 months ago (2016-06-02 18:36:55 UTC) #28
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as
https://skia.googlesource.com/skia/+/531237ef3aaf0d3c86e0853fde3b4c8f517bc662

Powered by Google App Engine
This is Rietveld 408576698