From f09263e957a3f132899458fc5afe859ba9d62d2e Mon Sep 17 00:00:00 2001 From: Jamie Gennis Date: Sun, 9 Sep 2012 17:53:27 -0700 Subject: [PATCH] SurfaceTexture: add updateTexImage synchronization This change makes the SurfaceTexture JNI updateTexImage call the native SurfaceTexture's doGLFenceWait method to perform the needed synchronization. Change-Id: Ie70a1fe6b44d439d1ffe7b97689a421ff8c02fda --- core/jni/android/graphics/SurfaceTexture.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/jni/android/graphics/SurfaceTexture.cpp b/core/jni/android/graphics/SurfaceTexture.cpp index c48b974fe7586..bc58813d6efed 100644 --- a/core/jni/android/graphics/SurfaceTexture.cpp +++ b/core/jni/android/graphics/SurfaceTexture.cpp @@ -223,6 +223,10 @@ static void SurfaceTexture_updateTexImage(JNIEnv* env, jobject thiz) } else if (err < 0) { jniThrowRuntimeException(env, "Error during updateTexImage (see logcat for details)"); } + err = surfaceTexture->doGLFenceWait(); + if (err != NO_ERROR) { + jniThrowRuntimeException(env, "Error waiting for fence (see logcat for details)"); + } } static jint SurfaceTexture_detachFromGLContext(JNIEnv* env, jobject thiz)