diff options
author | 2012-12-17 21:30:51 +0000 | |
---|---|---|
committer | 2012-12-17 21:30:51 +0000 | |
commit | 0c8ec2f658a206cbedd0d955167654fae85ad5fb (patch) | |
tree | 45c14611ed81a254d261d47048b3efd50fbed25f /src/core/SkBBoxRecord.cpp | |
parent | 57850b9daddd941f880d94faaf83f2169355a0c8 (diff) |
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
Diffstat (limited to 'src/core/SkBBoxRecord.cpp')
-rw-r--r-- | src/core/SkBBoxRecord.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/core/SkBBoxRecord.cpp b/src/core/SkBBoxRecord.cpp index 432d4adba4..cc18c7af25 100644 --- a/src/core/SkBBoxRecord.cpp +++ b/src/core/SkBBoxRecord.cpp @@ -27,7 +27,15 @@ void SkBBoxRecord::drawRect(const SkRect& rect, const SkPaint& paint) { } 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); } } |