summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Sams <rjsams@android.com>2010-01-19 17:56:52 -0800
committerJason Sams <rjsams@android.com>2010-01-19 17:56:52 -0800
commit6ec11bc3a80341206be9506619deb7f9171d38c9 (patch)
tree2e83292bcaedd43cb370fe10e7e650e7d8174fbd
parentb4ecab24dbff6e6dc9e7929655a55199fc32e8dd (diff)
downloadandroid_packages_apps_Trebuchet-6ec11bc3a80341206be9506619deb7f9171d38c9.tar.gz
android_packages_apps_Trebuchet-6ec11bc3a80341206be9506619deb7f9171d38c9.tar.bz2
android_packages_apps_Trebuchet-6ec11bc3a80341206be9506619deb7f9171d38c9.zip
Change text labels from RGBA to ALPHA8. Reduces memory usage and may increase performance.
-rw-r--r--res/raw/allapps.rs2
-rw-r--r--src/com/android/launcher2/AllAppsView.java10
-rw-r--r--src/com/android/launcher2/Utilities.java2
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,