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
This commit is contained in:
Alexandre Elias
2011-07-12 17:58:23 -07:00
parent 30e8f98277
commit 17e5f4cc70

View File

@@ -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;
}