diff options
| author | Christopher Tate <ctate@google.com> | 2011-11-10 19:59:13 -0800 |
|---|---|---|
| committer | Christopher Tate <ctate@google.com> | 2011-11-11 12:46:48 -0800 |
| commit | 1373a8eb581fe3c8e9a036e69042015f98a7e346 (patch) | |
| tree | 0f71cda77b7f24614a90b6ed428788f2cf8a85a0 /core/java/android/widget/EdgeEffect.java | |
| parent | a3cc20fff073bd3ca588f1e61f0f7034aecf3ebb (diff) | |
Localized optimizations in views and bitmaps
* Don't call context.getResources() redundantly when unnecessary;
similarly for Resources.getCompatibilityInfo()
* During bitmap creation, don't bother clearing to 0: it's unnecessary
because now that the raw bits are stored in a VM-side byte array, it
was cleared at initialization time. Also, don't use the sanity-
checking public entry point to erase to a color, because we know
that we're by definition in a "legal" path to erase to the initial
contents and don't need to incur the overhead of the (inappropriate)
sanity checking.
Change-Id: Idaca4d64fdecefd5d51337646ead32e1db510e02
Diffstat (limited to 'core/java/android/widget/EdgeEffect.java')
| -rw-r--r-- | core/java/android/widget/EdgeEffect.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/java/android/widget/EdgeEffect.java b/core/java/android/widget/EdgeEffect.java index fd2abc249d95..326587e6e7cb 100644 --- a/core/java/android/widget/EdgeEffect.java +++ b/core/java/android/widget/EdgeEffect.java @@ -129,7 +129,7 @@ public class EdgeEffect { mEdge = res.getDrawable(R.drawable.overscroll_edge); mGlow = res.getDrawable(R.drawable.overscroll_glow); - mMinWidth = (int) (context.getResources().getDisplayMetrics().density * MIN_WIDTH + 0.5f); + mMinWidth = (int) (res.getDisplayMetrics().density * MIN_WIDTH + 0.5f); mInterpolator = new DecelerateInterpolator(); } |
