diff options
author | Alexandre Elias <aelias@google.com> | 2011-07-12 17:58:23 -0700 |
---|---|---|
committer | Alexandre Elias <aelias@google.com> | 2011-07-12 18:08:10 -0700 |
commit | 17e5f4cc706bed08367af8fa60ffb8c7c3ca7f62 (patch) | |
tree | 458df7b689548331f22489c9487cbe969dc3fdc3 /native | |
parent | 30e8f982770e4c79f2703f11d100e1ff1bb3b7bf (diff) | |
download | frameworks_base-17e5f4cc706bed08367af8fa60ffb8c7c3ca7f62.zip frameworks_base-17e5f4cc706bed08367af8fa60ffb8c7c3ca7f62.tar.gz frameworks_base-17e5f4cc706bed08367af8fa60ffb8c7c3ca7f62.tar.bz2 |
Add notifyPixelsChanged() call to NDK unlockPixels().
Without this call, the NDK bitmap methods don't work in
hardware-accelerated mode ( http://b/5017848 ).
Change-Id: Icae6975757c9c9e83c0e9fc132161aa3004f8f28
Diffstat (limited to 'native')
-rw-r--r-- | native/graphics/jni/bitmap.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/native/graphics/jni/bitmap.cpp b/native/graphics/jni/bitmap.cpp index fd73430..51a631f 100644 --- a/native/graphics/jni/bitmap.cpp +++ b/native/graphics/jni/bitmap.cpp @@ -88,6 +88,12 @@ int AndroidBitmap_unlockPixels(JNIEnv* env, jobject jbitmap) { return ANDROID_BITMAP_RESULT_JNI_EXCEPTION; } + // notifyPixelsChanged() needs be called to apply writes to GL-backed + // bitmaps. Note that this will slow down read-only accesses to the + // bitmaps, but the NDK methods are primarily intended to be used for + // writes. + bm->notifyPixelsChanged(); + bm->unlockPixels(); return ANDROID_BITMAP_RESUT_SUCCESS; } |