Fix line rendering with TileGrid and Rtree

BUG=http://code.google.com/p/skia/issues/detail?id=1014
TEST=gm hairmodes with --tileGrid and --rtree
Review URL: https://codereview.appspot.com/6947056

git-svn-id: http://skia.googlecode.com/svn/trunk@6841 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/core/SkBBoxRecord.cpp b/src/core/SkBBoxRecord.cpp
index 5db77f5..628aa87 100644
--- a/src/core/SkBBoxRecord.cpp
+++ b/src/core/SkBBoxRecord.cpp
@@ -24,6 +24,18 @@
                               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);
     }