summaryrefslogtreecommitdiffstats
path: root/native
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2011-07-28 16:26:08 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-07-28 16:26:08 -0700
commitb3a900d7cd3842a208c0448b26806ed9f6d7fa2d (patch)
tree8cd653d4a27b3ed3983254d8e37e7534c2e399ca /native
parent8d88cde56dc6624501482f6a11bab4115025d78b (diff)
parent17e5f4cc706bed08367af8fa60ffb8c7c3ca7f62 (diff)
downloadframeworks_base-b3a900d7cd3842a208c0448b26806ed9f6d7fa2d.zip
frameworks_base-b3a900d7cd3842a208c0448b26806ed9f6d7fa2d.tar.gz
frameworks_base-b3a900d7cd3842a208c0448b26806ed9f6d7fa2d.tar.bz2
Merge "Add notifyPixelsChanged() call to NDK unlockPixels()."
Diffstat (limited to 'native')
-rw-r--r--native/graphics/jni/bitmap.cpp6
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;
}