summaryrefslogtreecommitdiffstats
path: root/graphics/java
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2010-08-19 15:06:50 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-08-19 15:06:50 -0700
commitd88e0680edd88e10870d5f6f303633cea839d686 (patch)
treebde16bfa93dd2cf34abbd4603fa23b6385dc74f9 /graphics/java
parent36c051c717391afe12a1fe8163960286175f2f7e (diff)
parent288471d8a57e1c318742cbfc28697877436fdb87 (diff)
downloadframeworks_base-d88e0680edd88e10870d5f6f303633cea839d686.zip
frameworks_base-d88e0680edd88e10870d5f6f303633cea839d686.tar.gz
frameworks_base-d88e0680edd88e10870d5f6f303633cea839d686.tar.bz2
am 288471d8: DO NOT MERGE. Load assets in place instead of deferring until draw.
Merge commit '288471d8a57e1c318742cbfc28697877436fdb87' into gingerbread-plus-aosp * commit '288471d8a57e1c318742cbfc28697877436fdb87': DO NOT MERGE. Load assets in place instead of deferring until draw.
Diffstat (limited to 'graphics/java')
-rw-r--r--graphics/java/android/graphics/BitmapFactory.java24
1 files changed, 11 insertions, 13 deletions
diff --git a/graphics/java/android/graphics/BitmapFactory.java b/graphics/java/android/graphics/BitmapFactory.java
index 8982388..02e16cd 100644
--- a/graphics/java/android/graphics/BitmapFactory.java
+++ b/graphics/java/android/graphics/BitmapFactory.java
@@ -27,7 +27,6 @@ import java.io.FileDescriptor;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
-import java.io.FileNotFoundException;
/**
* Creates Bitmap objects from various sources, including files, streams,
@@ -40,7 +39,7 @@ public class BitmapFactory {
* the same result from the decoder as if null were passed.
*/
public Options() {
- inDither = true;
+ inDither = false;
inScaled = true;
}
@@ -70,8 +69,11 @@ public class BitmapFactory {
* the decoder will try to pick the best matching config based on the
* system's screen depth, and characteristics of the original image such
* as if it has per-pixel alpha (requiring a config that also does).
+ *
+ * Image are loaded with the {@link Bitmap.Config#ARGB_8888} config by
+ * default.
*/
- public Bitmap.Config inPreferredConfig;
+ public Bitmap.Config inPreferredConfig = Bitmap.Config.ARGB_8888;
/**
* If dither is true, the decoder will attempt to dither the decoded
@@ -453,10 +455,8 @@ public class BitmapFactory {
// into is.read(...) This number is not related to the value passed
// to mark(...) above.
byte [] tempStorage = null;
- if (opts != null)
- tempStorage = opts.inTempStorage;
- if (tempStorage == null)
- tempStorage = new byte[16 * 1024];
+ if (opts != null) tempStorage = opts.inTempStorage;
+ if (tempStorage == null) tempStorage = new byte[16 * 1024];
bm = nativeDecodeStream(is, tempStorage, outPadding, opts);
}
@@ -475,8 +475,7 @@ public class BitmapFactory {
bm.setDensity(density);
final int targetDensity = opts.inTargetDensity;
- if (targetDensity == 0 || density == targetDensity
- || density == opts.inScreenDensity) {
+ if (targetDensity == 0 || density == targetDensity || density == opts.inScreenDensity) {
return bm;
}
@@ -673,8 +672,7 @@ public class BitmapFactory {
// pass some temp storage down to the native code. 1024 is made up,
// but should be large enough to avoid too many small calls back
// into is.read(...).
- byte [] tempStorage = null;
- tempStorage = new byte[16 * 1024];
+ byte [] tempStorage = new byte[16 * 1024];
return nativeCreateLargeBitmap(is, tempStorage, isShareable);
}
}
@@ -695,8 +693,8 @@ public class BitmapFactory {
* @throws IOException if the image format is not supported or can not be decoded.
* @hide
*/
- public static LargeBitmap createLargeBitmap(String pathName,
- boolean isShareable) throws FileNotFoundException, IOException {
+ public static LargeBitmap createLargeBitmap(String pathName, boolean isShareable)
+ throws IOException {
LargeBitmap bm = null;
InputStream stream = null;