summaryrefslogtreecommitdiff
path: root/libs/rs/java
diff options
context:
space:
mode:
author Jason Sams <rjsams@android.com> 2009-07-16 17:47:40 -0700
committer Jason Sams <rjsams@android.com> 2009-07-16 17:47:40 -0700
commit764205c19420256ccc05df2a1669a7b69c5daaf9 (patch)
tree59c966cad8f88d2dbcfb9fd88d6d7f5d8178587e /libs/rs/java
parenta2b0d2e422b481f532c36efc58f701791cb2c24a (diff)
Fix conflict with automatic DPI support on high density devices by forcing bitmap loading to not be scaled.
Diffstat (limited to 'libs/rs/java')
-rw-r--r--libs/rs/java/Rollo/res/raw/browser.png (renamed from libs/rs/java/Rollo/res/drawable/browser.png)bin5772 -> 5772 bytes
-rw-r--r--libs/rs/java/Rollo/res/raw/market.png (renamed from libs/rs/java/Rollo/res/drawable/market.png)bin4810 -> 4810 bytes
-rw-r--r--libs/rs/java/Rollo/res/raw/photos.png (renamed from libs/rs/java/Rollo/res/drawable/photos.png)bin4902 -> 4902 bytes
-rw-r--r--libs/rs/java/Rollo/res/raw/settings.png (renamed from libs/rs/java/Rollo/res/drawable/settings.png)bin3764 -> 3764 bytes
-rw-r--r--libs/rs/java/Rollo/src/com/android/rollo/RolloRS.java22
5 files changed, 12 insertions, 10 deletions
diff --git a/libs/rs/java/Rollo/res/drawable/browser.png b/libs/rs/java/Rollo/res/raw/browser.png
index 513f0be49693..513f0be49693 100644
--- a/libs/rs/java/Rollo/res/drawable/browser.png
+++ b/libs/rs/java/Rollo/res/raw/browser.png
Binary files differ
diff --git a/libs/rs/java/Rollo/res/drawable/market.png b/libs/rs/java/Rollo/res/raw/market.png
index 83b6910fcdec..83b6910fcdec 100644
--- a/libs/rs/java/Rollo/res/drawable/market.png
+++ b/libs/rs/java/Rollo/res/raw/market.png
Binary files differ
diff --git a/libs/rs/java/Rollo/res/drawable/photos.png b/libs/rs/java/Rollo/res/raw/photos.png
index 1ed8f1e811ad..1ed8f1e811ad 100644
--- a/libs/rs/java/Rollo/res/drawable/photos.png
+++ b/libs/rs/java/Rollo/res/raw/photos.png
Binary files differ
diff --git a/libs/rs/java/Rollo/res/drawable/settings.png b/libs/rs/java/Rollo/res/raw/settings.png
index dd2cd9570486..dd2cd9570486 100644
--- a/libs/rs/java/Rollo/res/drawable/settings.png
+++ b/libs/rs/java/Rollo/res/raw/settings.png
Binary files differ
diff --git a/libs/rs/java/Rollo/src/com/android/rollo/RolloRS.java b/libs/rs/java/Rollo/src/com/android/rollo/RolloRS.java
index fc928d6e1bfc..daf3aa6fa9f6 100644
--- a/libs/rs/java/Rollo/src/com/android/rollo/RolloRS.java
+++ b/libs/rs/java/Rollo/src/com/android/rollo/RolloRS.java
@@ -24,6 +24,7 @@ import android.renderscript.ProgramVertexAlloc;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.Handler;
@@ -188,20 +189,21 @@ public class RolloRS {
RenderScript.ElementPredefined.USER_I32, mAllocIconIDBuf.length);
- BitmapDrawable bd;
Bitmap b;
-
- bd = (BitmapDrawable)mRes.getDrawable(R.drawable.browser);
- mIcons[0] = mRS.allocationCreateFromBitmap(bd.getBitmap(), RenderScript.ElementPredefined.RGB_565, true);
+ BitmapFactory.Options opts = new BitmapFactory.Options();
+ opts.inScaled = false;
+
+ b = BitmapFactory.decodeResource(mRes, R.raw.browser, opts);
+ mIcons[0] = mRS.allocationCreateFromBitmap(b, RenderScript.ElementPredefined.RGB_565, true);
- bd = (BitmapDrawable)mRes.getDrawable(R.drawable.market);
- mIcons[1] = mRS.allocationCreateFromBitmap(bd.getBitmap(), RenderScript.ElementPredefined.RGB_565, true);
+ b = BitmapFactory.decodeResource(mRes, R.raw.market, opts);
+ mIcons[1] = mRS.allocationCreateFromBitmap(b, RenderScript.ElementPredefined.RGB_565, true);
- bd = (BitmapDrawable)mRes.getDrawable(R.drawable.photos);
- mIcons[2] = mRS.allocationCreateFromBitmap(bd.getBitmap(), RenderScript.ElementPredefined.RGB_565, true);
+ b = BitmapFactory.decodeResource(mRes, R.raw.photos, opts);
+ mIcons[2] = mRS.allocationCreateFromBitmap(b, RenderScript.ElementPredefined.RGB_565, true);
- bd = (BitmapDrawable)mRes.getDrawable(R.drawable.settings);
- mIcons[3] = mRS.allocationCreateFromBitmap(bd.getBitmap(), RenderScript.ElementPredefined.RGB_565, true);
+ b = BitmapFactory.decodeResource(mRes, R.raw.settings, opts);
+ mIcons[3] = mRS.allocationCreateFromBitmap(b, RenderScript.ElementPredefined.RGB_565, true);
for(int ct=0; ct < mIcons.length; ct++) {
mIcons[ct].uploadToTexture(0);