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

Commit dad9c673 authored by Gilles Debunne's avatar Gilles Debunne Committed by Android (Google) Code Review
Browse files

Merge "Bug 5250788: Fix memory consumption issues in TextPaint."

parents e3238c98 63c885f8
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -72,8 +72,15 @@ public class TextPaint extends Paint {
        linkColor = tp.linkColor;
        drawableState = tp.drawableState;
        density = tp.density;
        underlineColors = tp.underlineColors;
        underlineThicknesses = tp.underlineThicknesses;

        if (tp.underlineColors != null) {
            if (underlineColors == null || underlineColors.length < tp.underlineCount) {
                underlineColors = new int[tp.underlineCount];
                underlineThicknesses = new float[tp.underlineCount];
            }
            System.arraycopy(tp.underlineColors, 0, underlineColors, 0, tp.underlineCount);
            System.arraycopy(tp.underlineThicknesses, 0, underlineThicknesses, 0, tp.underlineCount);
        }
        underlineCount = tp.underlineCount;
    }