summaryrefslogtreecommitdiffstats
path: root/graphics/jni
diff options
context:
space:
mode:
authorJason Sams <rjsams@android.com>2012-02-15 12:04:24 -0800
committerJason Sams <rjsams@android.com>2012-02-15 12:04:24 -0800
commit163766cbe798baf8e86eb8201bc6c3def931d59a (patch)
treee78c46b84146c0aec0948e65a016ea64dd437157 /graphics/jni
parentea555e27407ad2a32d2682c08f423d2af71f2a91 (diff)
downloadframeworks_base-163766cbe798baf8e86eb8201bc6c3def931d59a.zip
frameworks_base-163766cbe798baf8e86eb8201bc6c3def931d59a.tar.gz
frameworks_base-163766cbe798baf8e86eb8201bc6c3def931d59a.tar.bz2
Beging IO stream out from allocation to surface texture.
Change-Id: I4d6b7f7740a896d39b811d6fe7532bb00db62373
Diffstat (limited to 'graphics/jni')
-rw-r--r--graphics/jni/android_renderscript_RenderScript.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/graphics/jni/android_renderscript_RenderScript.cpp b/graphics/jni/android_renderscript_RenderScript.cpp
index 94f19b3..4d087b0 100644
--- a/graphics/jni/android_renderscript_RenderScript.cpp
+++ b/graphics/jni/android_renderscript_RenderScript.cpp
@@ -451,6 +451,37 @@ nAllocationGetSurfaceTextureID(JNIEnv *_env, jobject _this, RsContext con, jint
}
static void
+nAllocationSetSurfaceTexture(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;
+ if (sur != 0) {
+ sp<SurfaceTexture> st = SurfaceTexture_getSurfaceTexture(_env, sur);
+ window = new SurfaceTextureClient(st);
+ }
+
+ rsAllocationSetSurface(con, alloc, window.get());
+}
+
+static void
+nAllocationIoSend(JNIEnv *_env, jobject _this, RsContext con, RsAllocation alloc)
+{
+ LOG_API("nAllocationIoSend, con(%p), alloc(%p)", con, alloc);
+ rsAllocationIoSend(con, alloc);
+}
+
+static void
+nAllocationIoReceive(JNIEnv *_env, jobject _this, RsContext con, RsAllocation alloc)
+{
+ LOG_API("nAllocationIoReceive, con(%p), alloc(%p)", con, alloc);
+ rsAllocationIoReceive(con, alloc);
+}
+
+
+static void
nAllocationGenerateMipmaps(JNIEnv *_env, jobject _this, RsContext con, jint alloc)
{
LOG_API("nAllocationGenerateMipmaps, con(%p), a(%p)", con, (RsAllocation)alloc);
@@ -1277,6 +1308,9 @@ static JNINativeMethod methods[] = {
{"rsnAllocationSyncAll", "(III)V", (void*)nAllocationSyncAll },
{"rsnAllocationGetSurfaceTextureID", "(II)I", (void*)nAllocationGetSurfaceTextureID },
+{"rsnAllocationSetSurfaceTexture", "(IILandroid/graphics/SurfaceTexture;)V", (void*)nAllocationSetSurfaceTexture },
+{"rsnAllocationIoSend", "(II)V", (void*)nAllocationIoSend },
+{"rsnAllocationIoReceive", "(II)V", (void*)nAllocationIoReceive },
{"rsnAllocationData1D", "(IIIII[II)V", (void*)nAllocationData1D_i },
{"rsnAllocationData1D", "(IIIII[SI)V", (void*)nAllocationData1D_s },
{"rsnAllocationData1D", "(IIIII[BI)V", (void*)nAllocationData1D_b },