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

Commit e8b7642f authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Optimize Outline::setRoundRect"

parents e9a5e73f f5638339
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -42,8 +42,15 @@ public:
        mBounds.set(left, top, right, bottom);
        mRadius = radius;

        // update mPath to reflect new outline

        // Reuse memory if previous outline was the same shape (rect or round rect).
        if ( mPath.countVerbs() > 10) {
            mPath.reset();
        } else {
            mPath.rewind();
        }

        // update mPath to reflect new outline
        if (MathUtils::isPositive(radius)) {
            mPath.addRoundRect(SkRect::MakeLTRB(left, top, right, bottom), radius, radius);
        } else {