Delete dead code
Bug: 22378829 Every time setText is called a BoringLayout is created. BoringLayout internally creates a new Paint called mWorkPaint. However, creating a Paint turns out to be somewhat substantial amount of work, and mWorkPaint is never actually used. Deleting this shaves off roughly 50ms and 1,000 object creations during a fling on a listview. Change-Id: I5d03402b9027df6ce0f3e58160752c66c69a4d2d
This commit is contained in:
@@ -206,7 +206,6 @@ public abstract class Layout {
|
||||
|
||||
mText = text;
|
||||
mPaint = paint;
|
||||
mWorkPaint = new TextPaint();
|
||||
mWidth = width;
|
||||
mAlignment = align;
|
||||
mSpacingMult = spacingMult;
|
||||
@@ -1993,7 +1992,6 @@ public abstract class Layout {
|
||||
|
||||
private CharSequence mText;
|
||||
private TextPaint mPaint;
|
||||
/* package */ TextPaint mWorkPaint;
|
||||
private int mWidth;
|
||||
private Alignment mAlignment = Alignment.ALIGN_NORMAL;
|
||||
private float mSpacingMult;
|
||||
|
||||
Reference in New Issue
Block a user