From 846db33313aa0899fa7928256c6734964bd92520 Mon Sep 17 00:00:00 2001 From: Glenn Kasten Date: Fri, 4 Mar 2011 11:44:32 -0800 Subject: Bug 3515073 Add ANativeWindow_fromSurfaceTexture This is similar to ANativeWindow_fromSurface. Change-Id: Iaadc06a5d0d50685c34876aa89488c16e7cfaa65 --- core/jni/android/graphics/SurfaceTexture.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'core/jni') diff --git a/core/jni/android/graphics/SurfaceTexture.cpp b/core/jni/android/graphics/SurfaceTexture.cpp index 88de94f..c4e5878 100644 --- a/core/jni/android/graphics/SurfaceTexture.cpp +++ b/core/jni/android/graphics/SurfaceTexture.cpp @@ -19,6 +19,7 @@ #include #include +#include #include @@ -64,6 +65,15 @@ sp SurfaceTexture_getSurfaceTexture(JNIEnv* env, jobject thiz) return surfaceTexture; } +sp android_SurfaceTexture_getNativeWindow( + JNIEnv* env, jobject thiz) +{ + sp surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); + sp surfaceTextureClient(surfaceTexture != NULL ? + new SurfaceTextureClient(surfaceTexture) : NULL); + return surfaceTextureClient; +} + // ---------------------------------------------------------------------------- class JNISurfaceTextureContext : public SurfaceTexture::FrameAvailableListener -- cgit v1.1