diff options
author | Marco Nelissen <marcone@google.com> | 2012-10-08 08:38:23 -0700 |
---|---|---|
committer | Marco Nelissen <marcone@google.com> | 2012-10-08 09:15:46 -0700 |
commit | 55adc145d460be4b21de0d77be1f6076c3591e3c (patch) | |
tree | 19dccc9357fae4a9ab8579ee3cbdb37491f7b6a0 /graphics | |
parent | 0e2aade9f1cfbbbdb60889ca9e1399093eb542ac (diff) | |
download | frameworks_base-55adc145d460be4b21de0d77be1f6076c3591e3c.zip frameworks_base-55adc145d460be4b21de0d77be1f6076c3591e3c.tar.gz frameworks_base-55adc145d460be4b21de0d77be1f6076c3591e3c.tar.bz2 |
Adjust buffer position after copying
Make Bitmap.copyPixelsFromBuffer() adjust the buffer's position,
making it consistent with Bitmap.copyPixelsToBuffer().
b/6948775
Change-Id: Ie26f8050b1fb4d19cd39ee1a08b6f652a732fec3
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/java/android/graphics/Bitmap.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/graphics/java/android/graphics/Bitmap.java b/graphics/java/android/graphics/Bitmap.java index 6ba57809..4604437 100644 --- a/graphics/java/android/graphics/Bitmap.java +++ b/graphics/java/android/graphics/Bitmap.java @@ -413,6 +413,11 @@ public final class Bitmap implements Parcelable { } nativeCopyPixelsFromBuffer(mNativeBitmap, src); + + // now update the buffer's position + int position = src.position(); + position += bitmapBytes >> shift; + src.position(position); } /** |