summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Doba <dobavictor@google.com>2013-03-20 11:24:21 +0100
committerVictor Doba <dobavictor@google.com>2013-03-20 11:24:21 +0100
commit0055102404c767af2cd5fabf70acbc8317e33fe3 (patch)
treebc2461967cb34aa9071c36c3adf706a94908bdb9
parent39c14cee9cc748a932d78fb9d430effa12027f7b (diff)
downloadandroid_packages_apps_Gallery2-0055102404c767af2cd5fabf70acbc8317e33fe3.tar.gz
android_packages_apps_Gallery2-0055102404c767af2cd5fabf70acbc8317e33fe3.tar.bz2
android_packages_apps_Gallery2-0055102404c767af2cd5fabf70acbc8317e33fe3.zip
Method added to load scaled resource (with only alpha channel).
Change-Id: I1b9a58e0fd4c33c9748ad03f53d635c426a5102c
-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) {