Index: src/gpu/GrContext.cpp |
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp |
index b361b671c3b3080b9373ee30a76daf9ce91d7b7a..83fa60e5d5553f98ec3a367bc29d3ff741450c5c 100755 |
--- a/src/gpu/GrContext.cpp |
+++ b/src/gpu/GrContext.cpp |
@@ -522,6 +522,10 @@ private: |
SkScalar rad = SkScalarHalf(geometry.fStrokeWidth); |
fBounds.outset(rad, rad); |
geometry.fViewMatrix.mapRect(&fBounds); |
+ |
robertphillips
2015/05/07 13:17:17
rm "then" ?
|
+ // Since we don't have AA then we outset for a half pixel in each direction to account for |
+ // snapping |
robertphillips
2015/05/07 13:17:17
// This is conservative but, b.c. the hardware can
|
+ fBounds.outset(0.5f, 0.5f); |
robertphillips
2015/05/07 13:17:17
Shouldn't this only occur for hairlines? For fills
|
} |
/* create a triangle strip that strokes the specified rect. There are 8 |
@@ -1021,6 +1025,12 @@ void GrContext::drawVertices(GrRenderTarget* rt, |
viewMatrix.mapRect(&bounds); |
+ // If we don't have AA then we outset for a half pixel in each direction to account for |
+ // snapping |
+ if (!paint.isAntiAlias()) { |
+ bounds.outset(0.5f, 0.5f); |
+ } |
+ |
DrawVerticesBatch::Geometry geometry; |
geometry.fColor = paint.getColor(); |
SkAutoTUnref<GrBatch> batch(DrawVerticesBatch::Create(geometry, primitiveType, viewMatrix, |