diff options
author | 2012-11-26 12:06:39 -0800 | |
---|---|---|
committer | 2012-11-26 12:06:39 -0800 | |
commit | 1f58497e7dbab1b16e97c73b65559b852d0c2803 (patch) | |
tree | fab2be5c4008b03f0a73e6e7c24dfba30cd50b32 | |
parent | 0572954507b6f8ea124ddce657eb310ff5ab481e (diff) |
Clarify Bitmap.copyTo/FromPixelBuffer documentation
Change-Id: Ifb410df392a5ad6c83d6744e19aad13b9a4e811d
-rw-r--r-- | graphics/java/android/graphics/Bitmap.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/graphics/java/android/graphics/Bitmap.java b/graphics/java/android/graphics/Bitmap.java index 688fd7aa5355..89abdef88f71 100644 --- a/graphics/java/android/graphics/Bitmap.java +++ b/graphics/java/android/graphics/Bitmap.java @@ -82,6 +82,7 @@ public final class Bitmap implements Parcelable { if (sDefaultDensity >= 0) { return sDefaultDensity; } + //noinspection deprecation sDefaultDensity = DisplayMetrics.DENSITY_DEVICE; return sDefaultDensity; } @@ -360,6 +361,9 @@ public final class Bitmap implements Parcelable { * that if this bitmap stores its pixels pre-multiplied * (see {@link #isPremultiplied()}, the values in the buffer will also be * pre-multiplied.</p> + * <p>After this method returns, the current position of the buffer is + * updated: the position is incremented by the number of elements written + * in the buffer.</p> */ public void copyPixelsToBuffer(Buffer dst) { int elements = dst.remaining(); @@ -394,6 +398,10 @@ public final class Bitmap implements Parcelable { * overwriting the bitmap's pixels. The data in the buffer is not changed * in any way (unlike setPixels(), which converts from unpremultipled 32bit * to whatever the bitmap's native format is.</p> + * <p>After this method returns, the current position of the buffer is + * updated: the position is incremented by the number of elements read from + * the buffer. If you need to read the bitmap from the buffer again you must + * first rewind the buffer.</p> */ public void copyPixelsFromBuffer(Buffer src) { checkRecycled("copyPixelsFromBuffer called on recycled bitmap"); |