aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrAAConvexPathRenderer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/GrAAConvexPathRenderer.cpp')
-rw-r--r--src/gpu/GrAAConvexPathRenderer.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gpu/GrAAConvexPathRenderer.cpp b/src/gpu/GrAAConvexPathRenderer.cpp
index 52994758c0..4e3d859e0b 100644
--- a/src/gpu/GrAAConvexPathRenderer.cpp
+++ b/src/gpu/GrAAConvexPathRenderer.cpp
@@ -707,15 +707,16 @@ static void extract_verts(const GrAAConvexTessellator& tess,
// 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;
}
}