diff options
author | Leon Scroggins III <scroggo@google.com> | 2014-06-03 12:19:32 -0400 |
---|---|---|
committer | Leon Scroggins III <scroggo@google.com> | 2014-06-03 14:05:58 -0400 |
commit | 0aa39dc2dcfca20f4d9cbeb1699d48a4808f2c70 (patch) | |
tree | d2478b7f7b5080f5f8f1be3e0500a0924610c6d0 /graphics/java/android/graphics/BitmapFactory.java | |
parent | 522a0278065b929e0d75d1d118e26a39ed57f010 (diff) | |
download | frameworks_base-0aa39dc2dcfca20f4d9cbeb1699d48a4808f2c70.zip frameworks_base-0aa39dc2dcfca20f4d9cbeb1699d48a4808f2c70.tar.gz frameworks_base-0aa39dc2dcfca20f4d9cbeb1699d48a4808f2c70.tar.bz2 |
Ignore inPurgeable and inInputShareable.
These are discouraged anyway, due to the fact that using them may
result in decoding on the UI thread. Now that they are ignored, the
images will still be decoded; they just will never have their
memory purged, meaning there could be a RAM penalty. This is
acceptable, since apps are encouraged to instead use inBitmap to
manage bitmap memory.
This incidentally fixes BUG:15390468 by converting purgeable index8
(e.g. gif) images to non purgeable.
Change-Id: Ieaf3ab25d28d93fb94bdaea1eb3bd762f163b09a
Diffstat (limited to 'graphics/java/android/graphics/BitmapFactory.java')
-rw-r--r-- | graphics/java/android/graphics/BitmapFactory.java | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/graphics/java/android/graphics/BitmapFactory.java b/graphics/java/android/graphics/BitmapFactory.java index c20502f..bc20ea5 100644 --- a/graphics/java/android/graphics/BitmapFactory.java +++ b/graphics/java/android/graphics/BitmapFactory.java @@ -260,7 +260,11 @@ public class BitmapFactory { public boolean inScaled; /** - * If this is set to true, then the resulting bitmap will allocate its + * @deprecated As of {@link android.os.Build.VERSION_CODES#L}, this is + * ignored. + * + * In {@link android.os.Build.VERSION_CODES#KITKAT} and below, if this + * is set to true, then the resulting bitmap will allocate its * pixels such that they can be purged if the system needs to reclaim * memory. In that instance, when the pixels need to be accessed again * (e.g. the bitmap is drawn, getPixels() is called), they will be @@ -287,14 +291,20 @@ public class BitmapFactory { * android.graphics.BitmapFactory.Options)} or {@link #decodeFile(String, * android.graphics.BitmapFactory.Options)}.</p> */ + @Deprecated public boolean inPurgeable; /** - * This field works in conjuction with inPurgeable. If inPurgeable is - * false, then this field is ignored. If inPurgeable is true, then this - * field determines whether the bitmap can share a reference to the - * input data (inputstream, array, etc.) or if it must make a deep copy. + * @deprecated As of {@link android.os.Build.VERSION_CODES#L}, this is + * ignored. + * + * In {@link android.os.Build.VERSION_CODES#KITKAT} and below, this + * field works in conjuction with inPurgeable. If inPurgeable is false, + * then this field is ignored. If inPurgeable is true, then this field + * determines whether the bitmap can share a reference to the input + * data (inputstream, array, etc.) or if it must make a deep copy. */ + @Deprecated public boolean inInputShareable; /** |