am e0b39fc1: Merge "Account for hairlines in quick rejection logic" into jb-mr2-dev
* commit 'e0b39fc18c10224c4e66f70aa472d8497b1b4621': Account for hairlines in quick rejection logic
This commit is contained in:
@@ -165,7 +165,11 @@ public:
|
|||||||
return DeferredDisplayList::kOpBatch_None;
|
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:
|
protected:
|
||||||
SkPaint* getPaint(OpenGLRenderer& renderer) {
|
SkPaint* getPaint(OpenGLRenderer& renderer) {
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ void PathTessellator::expandBoundsForStroke(SkRect& bounds, const SkPaint* paint
|
|||||||
bool forceExpand) {
|
bool forceExpand) {
|
||||||
if (forceExpand || paint->getStyle() != SkPaint::kFill_Style) {
|
if (forceExpand || paint->getStyle() != SkPaint::kFill_Style) {
|
||||||
float outset = paint->getStrokeWidth() * 0.5f;
|
float outset = paint->getStrokeWidth() * 0.5f;
|
||||||
|
if (outset == 0) outset = 0.5f; // account for hairline
|
||||||
bounds.outset(outset, outset);
|
bounds.outset(outset, outset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user