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

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

Merge "Remove Path codepath in BulletSpan"

parents 2f5e1b47 59ff32c4
Loading
Loading
Loading
Loading
+1 −16
Original line number Diff line number Diff line
@@ -23,8 +23,6 @@ import android.annotation.Nullable;
import android.annotation.Px;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Path.Direction;
import android.os.Parcel;
import android.text.Layout;
import android.text.ParcelableSpan;
@@ -73,7 +71,6 @@ public class BulletSpan implements LeadingMarginSpan, ParcelableSpan {
    private final int mGapWidth;
    @Px
    private final int mBulletRadius;
    private Path mBulletPath = null;
    @ColorInt
    private final int mColor;
    private final boolean mWantColor;
@@ -224,19 +221,7 @@ public class BulletSpan implements LeadingMarginSpan, ParcelableSpan {
            final float yPosition = (top + bottom) / 2f;
            final float xPosition = x + dir * mBulletRadius;

            if (canvas.isHardwareAccelerated()) {
                if (mBulletPath == null) {
                    mBulletPath = new Path();
                    mBulletPath.addCircle(0.0f, 0.0f, mBulletRadius, Direction.CW);
                }

                canvas.save();
                canvas.translate(xPosition, yPosition);
                canvas.drawPath(mBulletPath, paint);
                canvas.restore();
            } else {
            canvas.drawCircle(xPosition, yPosition, mBulletRadius, paint);
            }

            if (mWantColor) {
                paint.setColor(oldcolor);