summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/data/DecodeUtils.java
diff options
context:
space:
mode:
authorOwen Lin <owenlin@google.com>2011-08-19 16:26:29 +0800
committerOwen Lin <owenlin@google.com>2011-08-19 16:33:57 +0800
commitb225416022949bbc265ead6832ef92e9e08aa3fe (patch)
treef5e435f7d832a7e94e631051b88dd0ab5e028834 /src/com/android/gallery3d/data/DecodeUtils.java
parenta2fba687d4d2dbb3b2db8866b054ecb0e42871b2 (diff)
downloadandroid_packages_apps_Snap-b225416022949bbc265ead6832ef92e9e08aa3fe.tar.gz
android_packages_apps_Snap-b225416022949bbc265ead6832ef92e9e08aa3fe.tar.bz2
android_packages_apps_Snap-b225416022949bbc265ead6832ef92e9e08aa3fe.zip
Fix unknown type for GL issue.
fix: 5171449 Change-Id: Ib62e3237584144e94be6be773c292002bea5d21c
Diffstat (limited to 'src/com/android/gallery3d/data/DecodeUtils.java')
-rw-r--r--src/com/android/gallery3d/data/DecodeUtils.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/com/android/gallery3d/data/DecodeUtils.java b/src/com/android/gallery3d/data/DecodeUtils.java
index e7ae638c2..da2d3e0ee 100644
--- a/src/com/android/gallery3d/data/DecodeUtils.java
+++ b/src/com/android/gallery3d/data/DecodeUtils.java
@@ -55,6 +55,13 @@ public class DecodeUtils {
BitmapFactory.decodeFile(filePath, options));
}
+ public static Bitmap requestDecode(JobContext jc, FileDescriptor fd, Options options) {
+ if (options == null) options = new Options();
+ jc.setCancelListener(new DecodeCanceller(options));
+ return ensureGLCompatibleBitmap(
+ BitmapFactory.decodeFileDescriptor(fd, null, options));
+ }
+
public static Bitmap requestDecode(JobContext jc, byte[] bytes,
Options options) {
return requestDecode(jc, bytes, 0, bytes.length, options);