Merge "Bug 5250788: Fix memory consumption issues in TextPaint."
This commit is contained in:
committed by
Android (Google) Code Review
commit
dad9c67396
@@ -72,8 +72,15 @@ public class TextPaint extends Paint {
|
|||||||
linkColor = tp.linkColor;
|
linkColor = tp.linkColor;
|
||||||
drawableState = tp.drawableState;
|
drawableState = tp.drawableState;
|
||||||
density = tp.density;
|
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;
|
underlineCount = tp.underlineCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user