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

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: 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..0235741c5abe96ea8714d2e4270b48d768889413 100644
--- a/src/gpu/GrAAConvexPathRenderer.cpp
+++ b/src/gpu/GrAAConvexPathRenderer.cpp
@@ -425,20 +425,26 @@ 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;
+
+ // Fill the interior, if any.
+ if (count > 2) {
Chris Dalton 2015/04/21 11:49:05 Do we need to worry about the case where two colin
bsalomon 2015/04/21 15:50:07 SkPath won't notice colinear lines when constructi
+ 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 +488,18 @@ 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;
+
+ // Fill the interior, if any.
+ if (count > 2) {
Chris Dalton 2015/04/21 11:41:59 I decided to err on the side of minimal change, bu
+ 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