summaryrefslogtreecommitdiffstats
path: root/src/com/android/gallery3d/data/DecodeUtils.java
diff options
context:
space:
mode:
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);