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);
import com.android.gallery3d.app.GalleryContext;
import com.android.gallery3d.common.Utils;
+import com.android.gallery3d.data.DecodeUtils;
import com.android.gallery3d.util.Future;
import com.android.gallery3d.util.ThreadPool;
import com.android.gallery3d.util.ThreadPool.CancelListener;
int tileLength = (TILE_SIZE + 2 * TILE_BORDER);
int borderLength = TILE_BORDER << mTileLevel;
try {
- mDecodedTile = mModel.getTile(
- mTileLevel, mX - borderLength, mY - borderLength, tileLength);
+ mDecodedTile = DecodeUtils.ensureGLCompatibleBitmap(mModel.getTile(
+ mTileLevel, mX - borderLength, mY - borderLength, tileLength));
return mDecodedTile != null;
} catch (Throwable t) {
Log.w(TAG, "fail to decode tile", t);