diff options
author | Glenn Kasten <gkasten@google.com> | 2011-03-11 16:31:55 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-03-11 16:31:55 -0800 |
commit | 7647091436c45af2d82f12c9ea9ec77fa309b49b (patch) | |
tree | a18e2556ba41a194b754d60c6929bc467cffbdc8 /core/jni/android | |
parent | f0230cca194c840684bab959856c56725fc40b87 (diff) | |
parent | 846db33313aa0899fa7928256c6734964bd92520 (diff) | |
download | frameworks_base-7647091436c45af2d82f12c9ea9ec77fa309b49b.zip frameworks_base-7647091436c45af2d82f12c9ea9ec77fa309b49b.tar.gz frameworks_base-7647091436c45af2d82f12c9ea9ec77fa309b49b.tar.bz2 |
Merge "Bug 3515073 Add ANativeWindow_fromSurfaceTexture" into honeycomb-mr1
Diffstat (limited to 'core/jni/android')
-rw-r--r-- | core/jni/android/graphics/SurfaceTexture.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
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 <stdio.h> #include <gui/SurfaceTexture.h> +#include <gui/SurfaceTextureClient.h> #include <android_runtime/AndroidRuntime.h> @@ -64,6 +65,15 @@ sp<SurfaceTexture> SurfaceTexture_getSurfaceTexture(JNIEnv* env, jobject thiz) return surfaceTexture; } +sp<ANativeWindow> android_SurfaceTexture_getNativeWindow( + JNIEnv* env, jobject thiz) +{ + sp<SurfaceTexture> surfaceTexture(SurfaceTexture_getSurfaceTexture(env, thiz)); + sp<SurfaceTextureClient> surfaceTextureClient(surfaceTexture != NULL ? + new SurfaceTextureClient(surfaceTexture) : NULL); + return surfaceTextureClient; +} + // ---------------------------------------------------------------------------- class JNISurfaceTextureContext : public SurfaceTexture::FrameAvailableListener |