Fixing bounding box computation for inverse filled paths in SkBBoxRecord
BUG=http://code.google.com/p/skia/issues/detail?id=1014
TEST=gm emptypath with --tileGrid
Review URL: https://codereview.appspot.com/6944062
git-svn-id: http://skia.googlecode.com/svn/trunk@6865 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/core/SkBBoxRecord.cpp b/src/core/SkBBoxRecord.cpp
index 432d4ad..cc18c7a 100644
--- a/src/core/SkBBoxRecord.cpp
+++ b/src/core/SkBBoxRecord.cpp
@@ -27,7 +27,15 @@
}
void SkBBoxRecord::drawPath(const SkPath& path, const SkPaint& paint) {
- if (this->transformBounds(path.getBounds(), &paint)) {
+ if (path.isInverseFillType()) {
+ // If path is inverse filled, use the current clip bounds as the
+ // path's device-space bounding box.
+ SkIRect clipBounds;
+ if (this->getClipDeviceBounds(&clipBounds)) {
+ this->handleBBox(SkRect::MakeFromIRect(clipBounds));
+ INHERITED::drawPath(path, paint);
+ }
+ } else if (this->transformBounds(path.getBounds(), &paint)) {
INHERITED::drawPath(path, paint);
}
}