summaryrefslogtreecommitdiffstats
path: root/graphics
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2012-10-08 08:38:23 -0700
committerMarco Nelissen <marcone@google.com>2012-10-08 09:15:46 -0700
commit55adc145d460be4b21de0d77be1f6076c3591e3c (patch)
tree19dccc9357fae4a9ab8579ee3cbdb37491f7b6a0 /graphics
parent0e2aade9f1cfbbbdb60889ca9e1399093eb542ac (diff)
downloadframeworks_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.java5
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);
}
/**