summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Doba <dobavictor@google.com>2013-03-20 03:28:14 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-03-20 03:28:14 -0700
commit26bf21943edfa94dd9d0d7f6c0dbcc1ed05b5289 (patch)
treeb50fff4e48d16bc488ef5aaa7d2ef6d45501593f
parent91adfa42485f6724a2dc60db0ba09fd2739b8cc6 (diff)
parent0055102404c767af2cd5fabf70acbc8317e33fe3 (diff)
downloadandroid_packages_apps_Gallery2-26bf21943edfa94dd9d0d7f6c0dbcc1ed05b5289.tar.gz
android_packages_apps_Gallery2-26bf21943edfa94dd9d0d7f6c0dbcc1ed05b5289.tar.bz2
android_packages_apps_Gallery2-26bf21943edfa94dd9d0d7f6c0dbcc1ed05b5289.zip
am 00551024: Method added to load scaled resource (with only alpha channel).
* commit '0055102404c767af2cd5fabf70acbc8317e33fe3': Method added to load scaled resource (with only alpha channel).
-rw-r--r--src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java b/src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java
index 499170a35..338cf51cd 100644
--- a/src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java
+++ b/src/com/android/gallery3d/filtershow/filters/ImageFilterRS.java
@@ -169,13 +169,14 @@ public abstract class ImageFilterRS extends ImageFilter {
return bitmapAlloc;
}
- public Allocation loadResourceAlpha(int resource) {
+ public Allocation loadScaledResourceAlpha(int resource, int inSampleSize) {
Resources res = null;
synchronized(ImageFilterRS.class) {
res = sRS.getApplicationContext().getResources();
}
final BitmapFactory.Options options = new BitmapFactory.Options();
options.inPreferredConfig = Bitmap.Config.ALPHA_8;
+ options.inSampleSize = inSampleSize;
Bitmap bitmap = BitmapFactory.decodeResource(
res,
resource, options);
@@ -184,6 +185,10 @@ public abstract class ImageFilterRS extends ImageFilter {
return ret;
}
+ public Allocation loadResourceAlpha(int resource) {
+ return loadScaledResourceAlpha(resource, 1);
+ }
+
public Allocation loadResource(int resource) {
Resources res = null;
synchronized(ImageFilterRS.class) {