const SkPaint& paint) {
SkRect bbox;
bbox.set(pts, count);
+ // Small min width value, just to ensure hairline point bounding boxes aren't empty.
+ // Even though we know hairline primitives are drawn one pixel wide, we do not use a
+ // minimum of 1 because the playback scale factor is unknown at record time. Later
+ // outsets will take care of adding additional padding for antialiasing and rounding out
+ // to integer device coordinates, guaranteeing that the rasterized pixels will be included
+ // in the computed bounds.
+ // Note: The device coordinate outset in SkBBoxHierarchyRecord::handleBBox is currently
+ // done in the recording coordinate space, which is wrong.
+ // http://code.google.com/p/skia/issues/detail?id=1021
+ static const SkScalar kMinWidth = SkFloatToScalar(0.01f);
+ SkScalar halfStrokeWidth = SkMaxScalar(paint.getStrokeWidth(), kMinWidth) / 2;
+ bbox.outset(halfStrokeWidth, halfStrokeWidth);
if (this->transformBounds(bbox, &paint)) {
INHERITED::drawPoints(mode, count, pts, paint);
}