@@ -218,6 +218,18 @@ static jint SurfaceTexture_updateTexImage(JNIEnv* env, jobject thiz)
218218 return surfaceTexture->updateTexImage ();
219219}
220220
221+ static jint SurfaceTexture_detachFromGLContext (JNIEnv* env, jobject thiz)
222+ {
223+ sp<SurfaceTexture> surfaceTexture (SurfaceTexture_getSurfaceTexture (env, thiz));
224+ return surfaceTexture->detachFromContext ();
225+ }
226+
227+ static jint SurfaceTexture_attachToGLContext (JNIEnv* env, jobject thiz, jint tex)
228+ {
229+ sp<SurfaceTexture> surfaceTexture (SurfaceTexture_getSurfaceTexture (env, thiz));
230+ return surfaceTexture->attachToContext ((GLuint)tex);
231+ }
232+
221233static void SurfaceTexture_getTransformMatrix (JNIEnv* env, jobject thiz,
222234 jfloatArray jmtx)
223235{
@@ -242,14 +254,16 @@ static void SurfaceTexture_release(JNIEnv* env, jobject thiz)
242254// ----------------------------------------------------------------------------
243255
244256static JNINativeMethod gSurfaceTextureMethods [] = {
245- {" nativeClassInit" , " ()V" , (void *)SurfaceTexture_classInit },
246- {" nativeInit" , " (ILjava/lang/Object;Z)V" , (void *)SurfaceTexture_init },
247- {" nativeFinalize" , " ()V" , (void *)SurfaceTexture_finalize },
257+ {" nativeClassInit" , " ()V" , (void *)SurfaceTexture_classInit },
258+ {" nativeInit" , " (ILjava/lang/Object;Z)V" , (void *)SurfaceTexture_init },
259+ {" nativeFinalize" , " ()V" , (void *)SurfaceTexture_finalize },
248260 {" nativeSetDefaultBufferSize" , " (II)V" , (void *)SurfaceTexture_setDefaultBufferSize },
249- {" nativeUpdateTexImage" , " ()I" , (void *)SurfaceTexture_updateTexImage },
250- {" nativeGetTransformMatrix" , " ([F)V" , (void *)SurfaceTexture_getTransformMatrix },
251- {" nativeGetTimestamp" , " ()J" , (void *)SurfaceTexture_getTimestamp },
252- {" nativeRelease" , " ()V" , (void *)SurfaceTexture_release },
261+ {" nativeUpdateTexImage" , " ()I" , (void *)SurfaceTexture_updateTexImage },
262+ {" nativeDetachFromGLContext" , " ()I" , (void *)SurfaceTexture_detachFromGLContext },
263+ {" nativeAttachToGLContext" , " (I)I" , (void *)SurfaceTexture_attachToGLContext },
264+ {" nativeGetTransformMatrix" , " ([F)V" , (void *)SurfaceTexture_getTransformMatrix },
265+ {" nativeGetTimestamp" , " ()J" , (void *)SurfaceTexture_getTimestamp },
266+ {" nativeRelease" , " ()V" , (void *)SurfaceTexture_release },
253267};
254268
255269int register_android_graphics_SurfaceTexture (JNIEnv* env)
0 commit comments