diff options
Diffstat (limited to 'core/jni')
-rw-r--r-- | core/jni/android/graphics/SurfaceTexture.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/jni/android/graphics/SurfaceTexture.cpp b/core/jni/android/graphics/SurfaceTexture.cpp index 35d69fe..08d61d5 100644 --- a/core/jni/android/graphics/SurfaceTexture.cpp +++ b/core/jni/android/graphics/SurfaceTexture.cpp @@ -341,6 +341,12 @@ static void SurfaceTexture_release(JNIEnv* env, jobject thiz) surfaceTexture->abandon(); } +static jboolean SurfaceTexture_isReleased(JNIEnv* env, jobject thiz) +{ + sp<GLConsumer> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); + return surfaceTexture->isAbandoned(); +} + // ---------------------------------------------------------------------------- static JNINativeMethod gSurfaceTextureMethods[] = { @@ -355,6 +361,7 @@ static JNINativeMethod gSurfaceTextureMethods[] = { {"nativeGetTransformMatrix", "([F)V", (void*)SurfaceTexture_getTransformMatrix }, {"nativeGetTimestamp", "()J", (void*)SurfaceTexture_getTimestamp }, {"nativeRelease", "()V", (void*)SurfaceTexture_release }, + {"nativeIsReleased", "()Z", (void*)SurfaceTexture_isReleased }, }; int register_android_graphics_SurfaceTexture(JNIEnv* env) |