Fix clipping of ovals on top & right
http://codereview.appspot.com/6294091/
git-svn-id: http://skia.googlecode.com/svn/trunk@4303 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index fc2b143..0fada64 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -1126,10 +1126,13 @@
CircleVertex* verts = reinterpret_cast<CircleVertex*>(geo.vertices());
- SkScalar L = center.fX - outerRadius;
- SkScalar R = center.fX + outerRadius;
- SkScalar T = center.fY - outerRadius;
- SkScalar B = center.fY + outerRadius;
+ // The fragment shader will extend the radius out half a pixel
+ // to antialias. Expand the drawn rect here so all the pixels
+ // will be captured.
+ SkScalar L = center.fX - outerRadius - SkFloatToScalar(0.5f);
+ SkScalar R = center.fX + outerRadius + SkFloatToScalar(0.5f);
+ SkScalar T = center.fY - outerRadius - SkFloatToScalar(0.5f);
+ SkScalar B = center.fY + outerRadius + SkFloatToScalar(0.5f);
verts[0].fPos = SkPoint::Make(L, T);
verts[1].fPos = SkPoint::Make(R, T);