summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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) {