Loading core/jni/android_view_Surface.cpp +11 −11 Original line number Diff line number Diff line Loading @@ -101,17 +101,7 @@ sp<Surface> android_view_Surface_getSurface(JNIEnv* env, jobject surfaceObj) { return sur; } jobject android_view_Surface_createFromIGraphicBufferProducer(JNIEnv* env, const sp<IGraphicBufferProducer>& bufferProducer) { if (bufferProducer == NULL) { return NULL; } sp<Surface> surface(new Surface(bufferProducer, true)); if (surface == NULL) { return NULL; } jobject android_view_Surface_createFromSurface(JNIEnv* env, const sp<Surface>& surface) { jobject surfaceObj = env->NewObject(gSurfaceClassInfo.clazz, gSurfaceClassInfo.ctor, (jlong)surface.get()); if (surfaceObj == NULL) { Loading @@ -126,6 +116,16 @@ jobject android_view_Surface_createFromIGraphicBufferProducer(JNIEnv* env, return surfaceObj; } jobject android_view_Surface_createFromIGraphicBufferProducer(JNIEnv* env, const sp<IGraphicBufferProducer>& bufferProducer) { if (bufferProducer == NULL) { return NULL; } sp<Surface> surface(new Surface(bufferProducer, true)); return android_view_Surface_createFromSurface(env, surface); } int android_view_Surface_mapPublicFormatToHalFormat(PublicFormat f) { switch(f) { Loading core/jni/include/android_runtime/android_view_Surface.h +4 −0 Original line number Diff line number Diff line Loading @@ -69,6 +69,10 @@ extern bool android_view_Surface_isInstanceOf(JNIEnv* env, jobject obj); /* Gets the underlying Surface from a Surface Java object. */ extern sp<Surface> android_view_Surface_getSurface(JNIEnv* env, jobject surfaceObj); /* Creates a Surface from an android::Surface. */ extern jobject android_view_Surface_createFromSurface(JNIEnv* env, const sp<Surface>& surface); /* Creates a Surface from an IGraphicBufferProducer. */ extern jobject android_view_Surface_createFromIGraphicBufferProducer(JNIEnv* env, const sp<IGraphicBufferProducer>& bufferProducer); Loading native/android/libandroid.map.txt +1 −0 Original line number Diff line number Diff line Loading @@ -153,6 +153,7 @@ LIBANDROID { ANativeWindow_acquire; ANativeWindow_fromSurface; ANativeWindow_fromSurfaceTexture; # introduced-arm=13 introduced-mips=13 introduced-x86=13 ANativeWindow_toSurface; # introduced=26 ANativeWindow_getFormat; ANativeWindow_getHeight; ANativeWindow_getWidth; Loading native/android/native_window_jni.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include <android/native_window.h> #include <system/window.h> #include <gui/Surface.h> #include <utils/StrongPointer.h> #include <android_runtime/android_view_Surface.h> Loading @@ -33,3 +34,11 @@ ANativeWindow* ANativeWindow_fromSurface(JNIEnv* env, jobject surface) { } return win.get(); } jobject ANativeWindow_toSurface(JNIEnv* env, ANativeWindow* window) { if (window == NULL) { return NULL; } sp<Surface> surface = static_cast<Surface*>(window); return android_view_Surface_createFromSurface(env, surface); } Loading
core/jni/android_view_Surface.cpp +11 −11 Original line number Diff line number Diff line Loading @@ -101,17 +101,7 @@ sp<Surface> android_view_Surface_getSurface(JNIEnv* env, jobject surfaceObj) { return sur; } jobject android_view_Surface_createFromIGraphicBufferProducer(JNIEnv* env, const sp<IGraphicBufferProducer>& bufferProducer) { if (bufferProducer == NULL) { return NULL; } sp<Surface> surface(new Surface(bufferProducer, true)); if (surface == NULL) { return NULL; } jobject android_view_Surface_createFromSurface(JNIEnv* env, const sp<Surface>& surface) { jobject surfaceObj = env->NewObject(gSurfaceClassInfo.clazz, gSurfaceClassInfo.ctor, (jlong)surface.get()); if (surfaceObj == NULL) { Loading @@ -126,6 +116,16 @@ jobject android_view_Surface_createFromIGraphicBufferProducer(JNIEnv* env, return surfaceObj; } jobject android_view_Surface_createFromIGraphicBufferProducer(JNIEnv* env, const sp<IGraphicBufferProducer>& bufferProducer) { if (bufferProducer == NULL) { return NULL; } sp<Surface> surface(new Surface(bufferProducer, true)); return android_view_Surface_createFromSurface(env, surface); } int android_view_Surface_mapPublicFormatToHalFormat(PublicFormat f) { switch(f) { Loading
core/jni/include/android_runtime/android_view_Surface.h +4 −0 Original line number Diff line number Diff line Loading @@ -69,6 +69,10 @@ extern bool android_view_Surface_isInstanceOf(JNIEnv* env, jobject obj); /* Gets the underlying Surface from a Surface Java object. */ extern sp<Surface> android_view_Surface_getSurface(JNIEnv* env, jobject surfaceObj); /* Creates a Surface from an android::Surface. */ extern jobject android_view_Surface_createFromSurface(JNIEnv* env, const sp<Surface>& surface); /* Creates a Surface from an IGraphicBufferProducer. */ extern jobject android_view_Surface_createFromIGraphicBufferProducer(JNIEnv* env, const sp<IGraphicBufferProducer>& bufferProducer); Loading
native/android/libandroid.map.txt +1 −0 Original line number Diff line number Diff line Loading @@ -153,6 +153,7 @@ LIBANDROID { ANativeWindow_acquire; ANativeWindow_fromSurface; ANativeWindow_fromSurfaceTexture; # introduced-arm=13 introduced-mips=13 introduced-x86=13 ANativeWindow_toSurface; # introduced=26 ANativeWindow_getFormat; ANativeWindow_getHeight; ANativeWindow_getWidth; Loading
native/android/native_window_jni.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include <android/native_window.h> #include <system/window.h> #include <gui/Surface.h> #include <utils/StrongPointer.h> #include <android_runtime/android_view_Surface.h> Loading @@ -33,3 +34,11 @@ ANativeWindow* ANativeWindow_fromSurface(JNIEnv* env, jobject surface) { } return win.get(); } jobject ANativeWindow_toSurface(JNIEnv* env, ANativeWindow* window) { if (window == NULL) { return NULL; } sp<Surface> surface = static_cast<Surface*>(window); return android_view_Surface_createFromSurface(env, surface); }