diff options
author | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-06-22 13:14:29 +0000 |
---|---|---|
committer | robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-06-22 13:14:29 +0000 |
commit | a0a66c118392fdc6f84f18ac634473468e31becb (patch) | |
tree | 8e659afd50b06f5d36d3f1389288a83119001e11 /src | |
parent | ed38495c7cf5bdeb2843b6f1f090579fbefe497d (diff) |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/GrContext.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp index fc2b143c60..0fada64b95 100644 --- a/src/gpu/GrContext.cpp +++ b/src/gpu/GrContext.cpp @@ -1126,10 +1126,13 @@ void GrContext::drawOval(const GrPaint& paint, 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); |