diff options
author | Jason Sams <jsams@google.com> | 2012-03-28 15:30:07 -0700 |
---|---|---|
committer | Jason Sams <jsams@google.com> | 2012-03-28 15:30:07 -0700 |
commit | fb9aa9f3ef11878caaf6fcfb5ea49ffb9f7abf33 (patch) | |
tree | 385317786534f5f286a5e565017a3d6d507f0b3c /graphics/jni | |
parent | 972ed5809c518ecaaca58723e85282e58c12758c (diff) | |
download | base-fb9aa9f3ef11878caaf6fcfb5ea49ffb9f7abf33.tar.gz |
Convert from SurfaceTexture to Surface
Change-Id: I2ad4307294d4144999ca0c12ac19849b188243fb
Diffstat (limited to 'graphics/jni')
-rw-r--r-- | graphics/jni/android_renderscript_RenderScript.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/graphics/jni/android_renderscript_RenderScript.cpp b/graphics/jni/android_renderscript_RenderScript.cpp index 9d4c64f27674..1b7ef22d8d18 100644 --- a/graphics/jni/android_renderscript_RenderScript.cpp +++ b/graphics/jni/android_renderscript_RenderScript.cpp @@ -41,6 +41,7 @@ #include <rs.h> #include <rsEnv.h> +#include <gui/Surface.h> #include <gui/SurfaceTexture.h> #include <gui/SurfaceTextureClient.h> #include <android_runtime/android_graphics_SurfaceTexture.h> @@ -486,19 +487,17 @@ nAllocationGetSurfaceTextureID2(JNIEnv *_env, jobject _this, RsContext con, jint } static void -nAllocationSetSurfaceTexture(JNIEnv *_env, jobject _this, RsContext con, - RsAllocation alloc, jobject sur) +nAllocationSetSurface(JNIEnv *_env, jobject _this, RsContext con, RsAllocation alloc, jobject sur) { LOG_API("nAllocationSetSurfaceTexture, con(%p), alloc(%p), surface(%p)", con, alloc, (Surface *)sur); - sp<ANativeWindow> window; + sp<Surface> s; if (sur != 0) { - sp<SurfaceTexture> st = SurfaceTexture_getSurfaceTexture(_env, sur); - window = new SurfaceTextureClient(st); + s = Surface_getSurface(_env, sur); } - rsAllocationSetSurface(con, alloc, window.get()); + rsAllocationSetSurface(con, alloc, static_cast<ANativeWindow *>(s.get())); } static void @@ -1362,7 +1361,7 @@ static JNINativeMethod methods[] = { {"rsnAllocationSyncAll", "(III)V", (void*)nAllocationSyncAll }, {"rsnAllocationGetSurfaceTextureID", "(II)I", (void*)nAllocationGetSurfaceTextureID }, {"rsnAllocationGetSurfaceTextureID2","(IILandroid/graphics/SurfaceTexture;)V",(void*)nAllocationGetSurfaceTextureID2 }, -{"rsnAllocationSetSurfaceTexture", "(IILandroid/graphics/SurfaceTexture;)V",(void*)nAllocationSetSurfaceTexture }, +{"rsnAllocationSetSurface", "(IILandroid/view/Surface;)V", (void*)nAllocationSetSurface }, {"rsnAllocationIoSend", "(II)V", (void*)nAllocationIoSend }, {"rsnAllocationIoReceive", "(II)V", (void*)nAllocationIoReceive }, {"rsnAllocationData1D", "(IIIII[II)V", (void*)nAllocationData1D_i }, |