Merge "Account for hairlines in quick rejection logic" into jb-mr2-dev

This commit is contained in:
Chris Craik
2013-04-03 19:43:46 +00:00
committed by Android (Google) Code Review
2 changed files with 6 additions and 1 deletions

View File

@@ -165,7 +165,11 @@ public:
return DeferredDisplayList::kOpBatch_None;
}
float strokeWidthOutset() { return mPaint->getStrokeWidth() * 0.5f; }
float strokeWidthOutset() {
float width = mPaint->getStrokeWidth();
if (width == 0) return 0.5f; // account for hairline
return width * 0.5f;
}
protected:
SkPaint* getPaint(OpenGLRenderer& renderer) {

View File

@@ -61,6 +61,7 @@ void PathTessellator::expandBoundsForStroke(SkRect& bounds, const SkPaint* paint
bool forceExpand) {
if (forceExpand || paint->getStyle() != SkPaint::kFill_Style) {
float outset = paint->getStrokeWidth() * 0.5f;
if (outset == 0) outset = 0.5f; // account for hairline
bounds.outset(outset, outset);
}
}