Index: src/gpu/GrAAConvexPathRenderer.cpp |
diff --git a/src/gpu/GrAAConvexPathRenderer.cpp b/src/gpu/GrAAConvexPathRenderer.cpp |
index 52994758c019dfaeb5dea5ea7fb8450bbfd73612..4e3d859e0ba568e125c72b2c650a412444455fd1 100644 |
--- a/src/gpu/GrAAConvexPathRenderer.cpp |
+++ b/src/gpu/GrAAConvexPathRenderer.cpp |
@@ -707,15 +707,16 @@ |
// Make 'verts' point to the colors |
verts += sizeof(SkPoint); |
for (int i = 0; i < tess.numPts(); ++i) { |
+ SkASSERT(tess.depth(i) >= -0.5f && tess.depth(i) <= 0.5f); |
if (tweakAlphaForCoverage) { |
- SkASSERT(SkScalarRoundToInt(255.0f * tess.coverage(i)) <= 255); |
- unsigned scale = SkScalarRoundToInt(255.0f * tess.coverage(i)); |
+ SkASSERT(SkScalarRoundToInt(255.0f * (tess.depth(i) + 0.5f)) <= 255); |
+ unsigned scale = SkScalarRoundToInt(255.0f * (tess.depth(i) + 0.5f)); |
GrColor scaledColor = (0xff == scale) ? color : SkAlphaMulQ(color, scale); |
*reinterpret_cast<GrColor*>(verts + i * vertexStride) = scaledColor; |
} else { |
*reinterpret_cast<GrColor*>(verts + i * vertexStride) = color; |
*reinterpret_cast<float*>(verts + i * vertexStride + sizeof(GrColor)) = |
- tess.coverage(i); |
+ tess.depth(i) + 0.5f; |
} |
} |