summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Sams <rjsams@android.com>2010-01-19 18:02:04 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2010-01-19 18:02:04 -0800
commit168b007de7e071f66cf455c1558176a0f77107d5 (patch)
treea858a7042da9be8cc14b2cbe5d4597f945118a8e /src
parent4aea33d22eeb7d557f16a3149d00eb3303274a9d (diff)
parent6ec11bc3a80341206be9506619deb7f9171d38c9 (diff)
downloadandroid_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."
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher2/AllAppsView.java10
-rw-r--r--src/com/android/launcher2/Utilities.java2
2 files changed, 10 insertions, 2 deletions
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,