summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2011-01-17 12:51:55 -0800
committerRomain Guy <romainguy@google.com>2011-01-17 13:04:12 -0800
commit2361098da3b9d9c3eeed410dc72ba62c0e9177cf (patch)
treef3c5cb63e38bfb99ef76e10400cb846ecc21c812 /graphics
parent875862e3ec85153553ce50acc02863ea0720ccb6 (diff)
downloadframeworks_base-2361098da3b9d9c3eeed410dc72ba62c0e9177cf.zip
frameworks_base-2361098da3b9d9c3eeed410dc72ba62c0e9177cf.tar.gz
frameworks_base-2361098da3b9d9c3eeed410dc72ba62c0e9177cf.tar.bz2
Add BitmapFactory.Options.inMutable to load mutable bitmaps.
Change-Id: Iaa222127520f3aa55072d44af12ee3477908b876
Diffstat (limited to 'graphics')
-rw-r--r--graphics/java/android/graphics/Bitmap.java1
-rw-r--r--graphics/java/android/graphics/BitmapFactory.java10
2 files changed, 10 insertions, 1 deletions
diff --git a/graphics/java/android/graphics/Bitmap.java b/graphics/java/android/graphics/Bitmap.java
index a8efd00..e67ceed 100644
--- a/graphics/java/android/graphics/Bitmap.java
+++ b/graphics/java/android/graphics/Bitmap.java
@@ -53,6 +53,7 @@ public final class Bitmap implements Parcelable {
*/
public byte[] mBuffer;
+ @SuppressWarnings({"FieldCanBeLocal", "UnusedDeclaration"}) // Keep to finalize native resources
private final BitmapFinalizer mFinalizer;
private final boolean mIsMutable;
diff --git a/graphics/java/android/graphics/BitmapFactory.java b/graphics/java/android/graphics/BitmapFactory.java
index 8309f7a..dd6bf19 100644
--- a/graphics/java/android/graphics/BitmapFactory.java
+++ b/graphics/java/android/graphics/BitmapFactory.java
@@ -64,6 +64,14 @@ public class BitmapFactory {
public Bitmap inBitmap;
/**
+ * If set, decode methods will always return a mutable Bitmap instead of
+ * an immutable one. This can be used for instance to programmatically apply
+ * effects to a Bitmap loaded through BitmapFactory.
+ */
+ @SuppressWarnings({"UnusedDeclaration"}) // used in native code
+ public boolean inMutable;
+
+ /**
* If set to true, the decoder will return null (no bitmap), but
* the out... fields will still be set, allowing the caller to query
* the bitmap without having to allocate the memory for its pixels.
@@ -523,7 +531,7 @@ public class BitmapFactory {
}
bm.setDensity(targetDensity);
}
-
+
return bm;
}