Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e7c69c6f authored by Chris Craik's avatar Chris Craik
Browse files

Account for hairlines in quick rejection logic

bug:8531373
Change-Id: I35444014f23fc61da687694fccc0d13bce718793
parent 0102443c
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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) {
+1 −0
Original line number Diff line number Diff line
@@ -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);
    }
}