Lazily allocate the mBounds Rect in Drawable.

For background, see:
http://kohlerm.blogspot.com/2009/04/analyzing-memory-usage-off-your-android.html

Thanks, Markus!
This commit is contained in:
Brad Fitzpatrick
2009-04-27 10:51:06 -07:00
committed by Jean-Baptiste Queru
parent 17d53ff98b
commit 0f07b2c850

View File

@@ -101,7 +101,7 @@ public abstract class Drawable {
private int[] mStateSet = StateSet.WILD_CARD;
private int mLevel = 0;
private int mChangingConfigurations = 0;
private Rect mBounds = ZERO_BOUNDS_RECT;
private Rect mBounds = ZERO_BOUNDS_RECT; // lazily becomes a new Rect()
/*package*/ Callback mCallback = null;
private boolean mVisible = true;