summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/Util.java
diff options
context:
space:
mode:
authorChih-Chung Chang <chihchung@google.com>2009-07-24 10:58:40 +0800
committerChih-Chung Chang <chihchung@google.com>2009-07-24 15:42:52 +0800
commit4250e214f539a3caee1434889c5660d594b45dfd (patch)
tree58a11701ddcec57d12091c94b8ccc549a89a5a32 /src/com/android/camera/Util.java
parentd06aa697fb037b92b40b8e1ae6ab7db5c5b64d13 (diff)
downloadpackages_apps_LegacyCamera-4250e214f539a3caee1434889c5660d594b45dfd.zip
packages_apps_LegacyCamera-4250e214f539a3caee1434889c5660d594b45dfd.tar.gz
packages_apps_LegacyCamera-4250e214f539a3caee1434889c5660d594b45dfd.tar.bz2
Simplify ImageGetter.
Diffstat (limited to 'src/com/android/camera/Util.java')
-rw-r--r--src/com/android/camera/Util.java20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/com/android/camera/Util.java b/src/com/android/camera/Util.java
index 356426f..cefc6d8 100644
--- a/src/com/android/camera/Util.java
+++ b/src/com/android/camera/Util.java
@@ -302,10 +302,19 @@ public class Util {
*/
public static Bitmap makeBitmap(int targetWidthOrHeight, Uri uri,
ContentResolver cr) {
+ return makeBitmap(targetWidthOrHeight, uri, cr, false);
+ }
+
+ public static Bitmap makeBitmap(int targetWidthOrHeight, Uri uri,
+ ContentResolver cr, boolean useNative) {
ParcelFileDescriptor input = null;
try {
input = cr.openFileDescriptor(uri, "r");
- return makeBitmap(targetWidthOrHeight, uri, cr, input, null);
+ BitmapFactory.Options options = null;
+ if (useNative) {
+ options = createNativeAllocOptions();
+ }
+ return makeBitmap(targetWidthOrHeight, uri, cr, input, options);
} catch (IOException ex) {
return null;
} finally {
@@ -313,6 +322,15 @@ public class Util {
}
}
+ public static Bitmap makeBitmap(int targetWidthHeight,
+ ParcelFileDescriptor pfd, boolean useNative) {
+ BitmapFactory.Options options = null;
+ if (useNative) {
+ options = createNativeAllocOptions();
+ }
+ return makeBitmap(targetWidthHeight, null, null, pfd, options);
+ }
+
public static Bitmap makeBitmap(int targetWidthHeight, Uri uri,
ContentResolver cr, ParcelFileDescriptor pfd,
BitmapFactory.Options options) {