diff options
author | Jason Sams <rjsams@android.com> | 2010-12-14 19:12:44 -0800 |
---|---|---|
committer | Jason Sams <rjsams@android.com> | 2010-12-15 02:13:09 -0800 |
commit | 0508a5d4e679d52de6e902c07e63d5856225d616 (patch) | |
tree | 07078b8c246dc205f7ffbff8d770b5e23ad3a909 /carousel/java | |
parent | f664659f79399e92025e1dfe1ffbb682ff05613c (diff) | |
download | android_frameworks_ex-0508a5d4e679d52de6e902c07e63d5856225d616.tar.gz android_frameworks_ex-0508a5d4e679d52de6e902c07e63d5856225d616.tar.bz2 android_frameworks_ex-0508a5d4e679d52de6e902c07e63d5856225d616.zip |
Update for Allocation API changes.
Change-Id: If3b9d05825adf1bdb495f36e7d020af1bbdb5c7a
Diffstat (limited to 'carousel/java')
-rw-r--r-- | carousel/java/com/android/ex/carousel/CarouselRS.java | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/carousel/java/com/android/ex/carousel/CarouselRS.java b/carousel/java/com/android/ex/carousel/CarouselRS.java index 4b41d7c..371429e 100644 --- a/carousel/java/com/android/ex/carousel/CarouselRS.java +++ b/carousel/java/com/android/ex/carousel/CarouselRS.java @@ -60,7 +60,8 @@ public class CarouselRS { private static final String TAG = "CarouselRS"; private static final int DEFAULT_SLOT_COUNT = 10; - private static final boolean MIPMAP = false; + private static final Allocation.MipmapControl MIPMAP = + Allocation.MipmapControl.MIPMAP_NONE; private static final boolean DBG = false; private RenderScriptGL mRS; @@ -569,16 +570,15 @@ public class CarouselRS { mCallback = callback; } - private Allocation allocationFromBitmap(Bitmap bitmap, boolean mipmap) + private Allocation allocationFromBitmap(Bitmap bitmap, Allocation.MipmapControl mipmap) { if (bitmap == null) return null; Allocation allocation = Allocation.createFromBitmap(mRS, bitmap, - elementForBitmap(bitmap, Bitmap.Config.ARGB_4444), mipmap); - allocation.uploadToTexture(0); + mipmap, Allocation.USAGE_GRAPHICS_TEXTURE); return allocation; } - private Allocation allocationFromPool(int n, Bitmap bitmap, boolean mipmap) + private Allocation allocationFromPool(int n, Bitmap bitmap, Allocation.MipmapControl mipmap) { int count = (mVisibleSlots + mPrefetchCardCount) * mRowCount; if (mAllocationPool == null || mAllocationPool.length != count) { @@ -737,8 +737,7 @@ public class CarouselRS { Allocation texture = null; if (bitmap != null) { texture = Allocation.createFromBitmap(mRS, bitmap, - elementForBitmap(bitmap, Bitmap.Config.RGB_565), MIPMAP); - texture.uploadToTexture(0); + MIPMAP, Allocation.USAGE_GRAPHICS_TEXTURE); } mScript.set_backgroundTexture(texture); } @@ -747,8 +746,7 @@ public class CarouselRS { Allocation texture = null; if (bitmap != null) { texture = Allocation.createFromBitmap(mRS, bitmap, - elementForBitmap(bitmap, Bitmap.Config.ARGB_4444), MIPMAP); - texture.uploadToTexture(0); + MIPMAP, Allocation.USAGE_GRAPHICS_TEXTURE); } mScript.set_detailLineTexture(texture); } @@ -757,8 +755,7 @@ public class CarouselRS { Allocation texture = null; if (bitmap != null) { texture = Allocation.createFromBitmap(mRS, bitmap, - elementForBitmap(bitmap, Bitmap.Config.ARGB_4444), MIPMAP); - texture.uploadToTexture(0); + MIPMAP, Allocation.USAGE_GRAPHICS_TEXTURE); } mScript.set_detailLoadingTexture(texture); } |