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

Unified Diff: src/gpu/GrTessellator.cpp

Issue 2251643008: Tessellator: better fix for reused-edges issue. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrTessellator.cpp
diff --git a/src/gpu/GrTessellator.cpp b/src/gpu/GrTessellator.cpp
index 50d4af6148b30333789f68e663ee46c6aeac3651..ccffa9ffbeed21b29156e96c8d8e4cffe82e06c7 100644
--- a/src/gpu/GrTessellator.cpp
+++ b/src/gpu/GrTessellator.cpp
@@ -360,16 +360,12 @@ struct Poly {
MonotonePoly* fNext;
void addEdge(Edge* edge) {
if (fSide == kRight_Side) {
- if (edge->fUsedInRightPoly) {
- return;
- }
+ SkASSERT(!edge->fUsedInRightPoly);
list_insert<Edge, &Edge::fRightPolyPrev, &Edge::fRightPolyNext>(
edge, fLastEdge, nullptr, &fFirstEdge, &fLastEdge);
edge->fUsedInRightPoly = true;
} else {
- if (edge->fUsedInLeftPoly) {
- return;
- }
+ SkASSERT(!edge->fUsedInLeftPoly);
list_insert<Edge, &Edge::fLeftPolyPrev, &Edge::fLeftPolyNext>(
edge, fLastEdge, nullptr, &fFirstEdge, &fLastEdge);
edge->fUsedInLeftPoly = true;
@@ -423,6 +419,15 @@ struct Poly {
e->fTop->fID, e->fBottom->fID, fID, side == kLeft_Side ? "left" : "right");
Poly* partner = fPartner;
Poly* poly = this;
+ if (side == kRight_Side) {
+ if (e->fUsedInRightPoly) {
+ return this;
+ }
+ } else {
+ if (e->fUsedInLeftPoly) {
+ return this;
+ }
+ }
if (partner) {
fPartner = partner->fPartner = nullptr;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698