Loading graphics/java/android/renderscript/Allocation.java +25 −3 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.content.res.Resources; import android.content.res.AssetManager; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.view.Surface; import android.graphics.SurfaceTexture; import android.util.Log; import android.util.TypedValue; Loading Loading @@ -1184,18 +1185,39 @@ public class Allocation extends BaseObj { return st; } /** * * @hide * */ public Surface getSurface() { return new Surface(getSurfaceTexture()); } /** * @hide */ public void setSurfaceTexture(SurfaceTexture sur) { public void setSurface(Surface sur) { mRS.validate(); if ((mUsage & USAGE_IO_OUTPUT) == 0) { throw new RSInvalidStateException("Allocation is not USAGE_IO_OUTPUT."); } mRS.nAllocationSetSurface(getID(), sur); } /** * @hide */ public void setSurfaceTexture(SurfaceTexture st) { mRS.validate(); mRS.nAllocationSetSurfaceTexture(getID(), sur); if ((mUsage & USAGE_IO_OUTPUT) == 0) { throw new RSInvalidStateException("Allocation is not USAGE_IO_OUTPUT."); } Surface s = new Surface(st); mRS.nAllocationSetSurface(getID(), s); } /** * Creates a non-mipmapped renderscript allocation to use as a Loading graphics/java/android/renderscript/RenderScript.java +3 −3 Original line number Diff line number Diff line Loading @@ -299,10 +299,10 @@ public class RenderScript { validate(); rsnAllocationGetSurfaceTextureID2(mContext, alloc, st); } native void rsnAllocationSetSurfaceTexture(int con, int alloc, SurfaceTexture sur); synchronized void nAllocationSetSurfaceTexture(int alloc, SurfaceTexture sur) { native void rsnAllocationSetSurface(int con, int alloc, Surface sur); synchronized void nAllocationSetSurface(int alloc, Surface sur) { validate(); rsnAllocationSetSurfaceTexture(mContext, alloc, sur); rsnAllocationSetSurface(mContext, alloc, sur); } native void rsnAllocationIoSend(int con, int alloc); synchronized void nAllocationIoSend(int alloc) { Loading graphics/jni/android_renderscript_RenderScript.cpp +6 −7 Original line number Diff line number Diff line Loading @@ -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> Loading Loading @@ -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 Loading Loading @@ -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 }, Loading Loading
graphics/java/android/renderscript/Allocation.java +25 −3 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.content.res.Resources; import android.content.res.AssetManager; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.view.Surface; import android.graphics.SurfaceTexture; import android.util.Log; import android.util.TypedValue; Loading Loading @@ -1184,18 +1185,39 @@ public class Allocation extends BaseObj { return st; } /** * * @hide * */ public Surface getSurface() { return new Surface(getSurfaceTexture()); } /** * @hide */ public void setSurfaceTexture(SurfaceTexture sur) { public void setSurface(Surface sur) { mRS.validate(); if ((mUsage & USAGE_IO_OUTPUT) == 0) { throw new RSInvalidStateException("Allocation is not USAGE_IO_OUTPUT."); } mRS.nAllocationSetSurface(getID(), sur); } /** * @hide */ public void setSurfaceTexture(SurfaceTexture st) { mRS.validate(); mRS.nAllocationSetSurfaceTexture(getID(), sur); if ((mUsage & USAGE_IO_OUTPUT) == 0) { throw new RSInvalidStateException("Allocation is not USAGE_IO_OUTPUT."); } Surface s = new Surface(st); mRS.nAllocationSetSurface(getID(), s); } /** * Creates a non-mipmapped renderscript allocation to use as a Loading
graphics/java/android/renderscript/RenderScript.java +3 −3 Original line number Diff line number Diff line Loading @@ -299,10 +299,10 @@ public class RenderScript { validate(); rsnAllocationGetSurfaceTextureID2(mContext, alloc, st); } native void rsnAllocationSetSurfaceTexture(int con, int alloc, SurfaceTexture sur); synchronized void nAllocationSetSurfaceTexture(int alloc, SurfaceTexture sur) { native void rsnAllocationSetSurface(int con, int alloc, Surface sur); synchronized void nAllocationSetSurface(int alloc, Surface sur) { validate(); rsnAllocationSetSurfaceTexture(mContext, alloc, sur); rsnAllocationSetSurface(mContext, alloc, sur); } native void rsnAllocationIoSend(int con, int alloc); synchronized void nAllocationIoSend(int alloc) { Loading
graphics/jni/android_renderscript_RenderScript.cpp +6 −7 Original line number Diff line number Diff line Loading @@ -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> Loading Loading @@ -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 Loading Loading @@ -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 }, Loading