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

Unified Diff: src/gpu/GrAAConvexPathRenderer.cpp

Issue 1094293002: Fix double blend in GrAAConvexPathRenderer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove colinear lineTo stuff Created 5 years, 8 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/GrAAConvexPathRenderer.cpp
diff --git a/src/gpu/GrAAConvexPathRenderer.cpp b/src/gpu/GrAAConvexPathRenderer.cpp
index 1813803d8ad7ea41a7556ee1d32b01c366be8f60..690feb7be0ee629cad50676776778a64bfbf7703 100644
--- a/src/gpu/GrAAConvexPathRenderer.cpp
+++ b/src/gpu/GrAAConvexPathRenderer.cpp
@@ -425,20 +425,28 @@ static void create_vertices(const SegmentArray& segments,
verts[*v + 3].fD0 = verts[*v + 3].fD1 = -SK_Scalar1;
verts[*v + 4].fD0 = verts[*v + 4].fD1 = -SK_Scalar1;
- idxs[*i + 0] = *v + 0;
- idxs[*i + 1] = *v + 2;
- idxs[*i + 2] = *v + 1;
+ idxs[*i + 0] = *v + 3;
+ idxs[*i + 1] = *v + 1;
+ idxs[*i + 2] = *v + 2;
- idxs[*i + 3] = *v + 3;
- idxs[*i + 4] = *v + 1;
+ idxs[*i + 3] = *v + 4;
+ idxs[*i + 4] = *v + 3;
idxs[*i + 5] = *v + 2;
- idxs[*i + 6] = *v + 4;
- idxs[*i + 7] = *v + 3;
- idxs[*i + 8] = *v + 2;
+ *i += 6;
+
+ // Draw the interior fan if it exists.
+ // TODO: Detect and combine colinear segments. This will ensure we catch every case
+ // with no interior, and that the resulting shared edge uses the same endpoints.
+ if (count >= 3) {
+ idxs[*i + 0] = *v + 0;
+ idxs[*i + 1] = *v + 2;
+ idxs[*i + 2] = *v + 1;
+
+ *i += 3;
+ }
*v += 5;
- *i += 9;
} else {
SkPoint qpts[] = {sega.endPt(), segb.fPts[0], segb.fPts[1]};
@@ -482,12 +490,20 @@ static void create_vertices(const SegmentArray& segments,
idxs[*i + 7] = *v + 3;
idxs[*i + 8] = *v + 4;
- idxs[*i + 9] = *v + 0;
- idxs[*i + 10] = *v + 2;
- idxs[*i + 11] = *v + 1;
+ *i += 9;
+
+ // Draw the interior fan if it exists.
+ // TODO: Detect and combine colinear segments. This will ensure we catch every case
+ // with no interior, and that the resulting shared edge uses the same endpoints.
+ if (count >= 3) {
Chris Dalton 2015/04/29 16:38:04 I decided to err on the side of minimal code chang
+ idxs[*i + 0] = *v + 0;
+ idxs[*i + 1] = *v + 2;
+ idxs[*i + 2] = *v + 1;
+
+ *i += 3;
+ }
*v += 6;
- *i += 12;
}
}
}
« 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