Index: src/gpu/batches/GrNonAAStrokeRectBatch.cpp |
diff --git a/src/gpu/batches/GrNonAAStrokeRectBatch.cpp b/src/gpu/batches/GrNonAAStrokeRectBatch.cpp |
index a38760c362ea14b8f04796bf07f9b5fe8c8972f2..61335523f7a87180ac104d6241c2480f25a020bd 100644 |
--- a/src/gpu/batches/GrNonAAStrokeRectBatch.cpp |
+++ b/src/gpu/batches/GrNonAAStrokeRectBatch.cpp |
@@ -100,6 +100,16 @@ private: |
// If our caller snaps to pixel centers then we have to round out the bounds |
if (snapToPixelCenters) { |
+ // We want to be consistent with how we snap non-aa lines. To match what we do in |
+ // GrGLSLVertexShaderBuilder, we first floor all the vertex values and then add half a |
+ // pixel to force us to pixel centers. |
+ bounds->set(SkScalarFloorToScalar(bounds->fLeft), |
+ SkScalarFloorToScalar(bounds->fTop), |
+ SkScalarFloorToScalar(bounds->fRight), |
+ SkScalarFloorToScalar(bounds->fBottom)); |
+ bounds->offset(0.5f, 0.5f); |
+ |
+ // Round out the bounds to integer values |
bounds->roundOut(); |
bsalomon
2016/07/07 14:19:06
Do we need this round out? If the rect is rendered
|
} |
} |