diff options
author | Jason Sams <rjsams@android.com> | 2010-01-19 18:02:04 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-01-19 18:02:04 -0800 |
commit | 168b007de7e071f66cf455c1558176a0f77107d5 (patch) | |
tree | a858a7042da9be8cc14b2cbe5d4597f945118a8e | |
parent | 4aea33d22eeb7d557f16a3149d00eb3303274a9d (diff) | |
parent | 6ec11bc3a80341206be9506619deb7f9171d38c9 (diff) | |
download | android_packages_apps_Trebuchet-168b007de7e071f66cf455c1558176a0f77107d5.tar.gz android_packages_apps_Trebuchet-168b007de7e071f66cf455c1558176a0f77107d5.tar.bz2 android_packages_apps_Trebuchet-168b007de7e071f66cf455c1558176a0f77107d5.zip |
Merge "Change text labels from RGBA to ALPHA8. Reduces memory usage and may increase performance."
-rw-r--r-- | res/raw/allapps.rs | 2 | ||||
-rw-r--r-- | src/com/android/launcher2/AllAppsView.java | 10 | ||||
-rw-r--r-- | src/com/android/launcher2/Utilities.java | 2 |
3 files changed, 11 insertions, 3 deletions
diff --git a/res/raw/allapps.rs b/res/raw/allapps.rs index edbbcd826..8cbbea2f4 100644 --- a/res/raw/allapps.rs +++ b/res/raw/allapps.rs @@ -106,7 +106,7 @@ void move() { if (g_LastTouchDown) { float dx = -(state->newPositionX - g_LastPositionX); g_PosVelocity = 0; - g_PosPage += dx * 4; + g_PosPage += dx * 5.2f; float pmin = -0.49f; float pmax = g_PosMax + 0.49f; diff --git a/src/com/android/launcher2/AllAppsView.java b/src/com/android/launcher2/AllAppsView.java index 20572766e..424bc555e 100644 --- a/src/com/android/launcher2/AllAppsView.java +++ b/src/com/android/launcher2/AllAppsView.java @@ -784,6 +784,7 @@ public class AllAppsView extends RSSurfaceView private ProgramStore mPSText; private ProgramFragment mPFColor; private ProgramFragment mPFTexMip; + private ProgramFragment mPFTexMipAlpha; private ProgramFragment mPFTexNearest; private ProgramVertex mPV; private ProgramVertex mPVOrtho; @@ -1015,6 +1016,13 @@ public class AllAppsView extends RSSurfaceView mPFTexNearest = bf.create(); mPFTexNearest.setName("PFTexNearest"); mPFTexNearest.bindSampler(nearest, 0); + + bf.setTexture(ProgramFragment.Builder.EnvMode.MODULATE, + ProgramFragment.Builder.Format.ALPHA, 0); + mPFTexMipAlpha = bf.create(); + mPFTexMipAlpha.setName("PFTexMipAlpha"); + mPFTexMipAlpha.bindSampler(linear, 0); + } private void initProgramStore() { @@ -1152,7 +1160,7 @@ public class AllAppsView extends RSSurfaceView mIcons[index] = Allocation.createFromBitmap(mRS, item.iconBitmap, Element.RGBA_8888(mRS), true); mLabels[index] = Allocation.createFromBitmap(mRS, item.titleBitmap, - Element.RGBA_8888(mRS), true); + Element.A_8(mRS), true); mIconIds[index] = mIcons[index].getID(); mLabelIds[index] = mLabels[index].getID(); } diff --git a/src/com/android/launcher2/Utilities.java b/src/com/android/launcher2/Utilities.java index 507096cff..94e281b41 100644 --- a/src/com/android/launcher2/Utilities.java +++ b/src/com/android/launcher2/Utilities.java @@ -415,7 +415,7 @@ final class Utilities { /** You own the bitmap after this and you must call recycle on it. */ Bitmap createTextBitmap(String text) { - Bitmap b = Bitmap.createBitmap(mBitmapWidth, mBitmapHeight, Bitmap.Config.ARGB_8888); + Bitmap b = Bitmap.createBitmap(mBitmapWidth, mBitmapHeight, Bitmap.Config.ALPHA_8); Canvas c = new Canvas(b); StaticLayout layout = new StaticLayout(text, mTextPaint, (int)mTextWidth, |