diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-04-27 05:31:19 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2009-04-27 05:31:19 -0700 |
commit | 1fb758e94b5b9e342b6dc6452cb5bd7cf0cc4ed6 (patch) | |
tree | f09abf0ff05ea93100ed41541371dd18e651493d /graphics | |
parent | 01be1fa7930e92aac6ba4dd4e8cb75f8719e8b37 (diff) | |
parent | c70e06bbfac0d92ec218a32e35d9d7fa80f23cc9 (diff) | |
download | frameworks_base-1fb758e94b5b9e342b6dc6452cb5bd7cf0cc4ed6.zip frameworks_base-1fb758e94b5b9e342b6dc6452cb5bd7cf0cc4ed6.tar.gz frameworks_base-1fb758e94b5b9e342b6dc6452cb5bd7cf0cc4ed6.tar.bz2 |
Merge change 546 into donut
* changes:
Add (hidden for now) purgeable bitmaps
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/java/android/graphics/BitmapFactory.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/graphics/java/android/graphics/BitmapFactory.java b/graphics/java/android/graphics/BitmapFactory.java index 3813d8f..9e88d7e 100644 --- a/graphics/java/android/graphics/BitmapFactory.java +++ b/graphics/java/android/graphics/BitmapFactory.java @@ -103,6 +103,36 @@ public class BitmapFactory { public boolean inScaled; /** + * 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 + * automatically re-decoded. + * + * For the re-decode to happen, the bitmap must have access to the + * encoded data, either by sharing a reference to the input + * or by making a copy of it. This distinction is controlled by + * inInputShareable. If this is true, then the bitmap may keep a shallow + * reference to the input. If this is false, then the bitmap will + * explicitly make a copy of the input data, and keep that. Even if + * sharing is allowed, the implementation may still decide to make a + * deep copy of the input data. + * + * @hide pending API council approval + */ + 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. + * + * @hide pending API council approval + */ + public boolean inInputShareable; + + /** * The resulting width of the bitmap, set independent of the state of * inJustDecodeBounds. However, if there is an error trying to decode, * outWidth will be set to -1. |