summaryrefslogtreecommitdiffstats
path: root/graphics/jni
diff options
context:
space:
mode:
authorJason Sams <rjsams@android.com>2011-01-12 14:53:25 -0800
committerJason Sams <rjsams@android.com>2011-01-12 14:53:25 -0800
commitfb9f82ca4f11cf7e43a001f3e6fd1b381cc86210 (patch)
tree000fb80d2d73d062f9493cec84880974d77e68db /graphics/jni
parentf7086090cfc8d97b5bd3b4d7801a27af11f7c207 (diff)
downloadframeworks_base-fb9f82ca4f11cf7e43a001f3e6fd1b381cc86210.zip
frameworks_base-fb9f82ca4f11cf7e43a001f3e6fd1b381cc86210.tar.gz
frameworks_base-fb9f82ca4f11cf7e43a001f3e6fd1b381cc86210.tar.bz2
Implement more of copy2DRange*
Change-Id: Id6be481c4abc968df27e5bba1ed044262ec0f293
Diffstat (limited to 'graphics/jni')
-rw-r--r--graphics/jni/android_renderscript_RenderScript.cpp46
1 files changed, 46 insertions, 0 deletions
diff --git a/graphics/jni/android_renderscript_RenderScript.cpp b/graphics/jni/android_renderscript_RenderScript.cpp
index a7913d7..35db786 100644
--- a/graphics/jni/android_renderscript_RenderScript.cpp
+++ b/graphics/jni/android_renderscript_RenderScript.cpp
@@ -535,6 +535,28 @@ nAllocationElementData1D(JNIEnv *_env, jobject _this, RsContext con, jint alloc,
}
static void
+nAllocationData2D_s(JNIEnv *_env, jobject _this, RsContext con, jint alloc, jint xoff, jint yoff, jint lod, jint face,
+ jint w, jint h, jshortArray data, int sizeBytes)
+{
+ jint len = _env->GetArrayLength(data);
+ LOG_API("nAllocation2DData_s, con(%p), adapter(%p), xoff(%i), yoff(%i), w(%i), h(%i), len(%i)", con, (RsAllocation)alloc, xoff, yoff, w, h, len);
+ jshort *ptr = _env->GetShortArrayElements(data, NULL);
+ rsAllocation2DData(con, (RsAllocation)alloc, xoff, yoff, lod, (RsAllocationCubemapFace)face, w, h, ptr, sizeBytes);
+ _env->ReleaseShortArrayElements(data, ptr, JNI_ABORT);
+}
+
+static void
+nAllocationData2D_b(JNIEnv *_env, jobject _this, RsContext con, jint alloc, jint xoff, jint yoff, jint lod, jint face,
+ jint w, jint h, jbyteArray data, int sizeBytes)
+{
+ jint len = _env->GetArrayLength(data);
+ LOG_API("nAllocation2DData_b, con(%p), adapter(%p), xoff(%i), yoff(%i), w(%i), h(%i), len(%i)", con, (RsAllocation)alloc, xoff, yoff, w, h, len);
+ jbyte *ptr = _env->GetByteArrayElements(data, NULL);
+ rsAllocation2DData(con, (RsAllocation)alloc, xoff, yoff, lod, (RsAllocationCubemapFace)face, w, h, ptr, sizeBytes);
+ _env->ReleaseByteArrayElements(data, ptr, JNI_ABORT);
+}
+
+static void
nAllocationData2D_i(JNIEnv *_env, jobject _this, RsContext con, jint alloc, jint xoff, jint yoff, jint lod, jint face,
jint w, jint h, jintArray data, int sizeBytes)
{
@@ -567,6 +589,26 @@ nAllocationRead_i(JNIEnv *_env, jobject _this, RsContext con, jint alloc, jintAr
}
static void
+nAllocationRead_s(JNIEnv *_env, jobject _this, RsContext con, jint alloc, jshortArray data)
+{
+ jint len = _env->GetArrayLength(data);
+ LOG_API("nAllocationRead_i, con(%p), alloc(%p), len(%i)", con, (RsAllocation)alloc, len);
+ jshort *ptr = _env->GetShortArrayElements(data, NULL);
+ rsAllocationRead(con, (RsAllocation)alloc, ptr);
+ _env->ReleaseShortArrayElements(data, ptr, 0);
+}
+
+static void
+nAllocationRead_b(JNIEnv *_env, jobject _this, RsContext con, jint alloc, jbyteArray data)
+{
+ jint len = _env->GetArrayLength(data);
+ LOG_API("nAllocationRead_i, con(%p), alloc(%p), len(%i)", con, (RsAllocation)alloc, len);
+ jbyte *ptr = _env->GetByteArrayElements(data, NULL);
+ rsAllocationRead(con, (RsAllocation)alloc, ptr);
+ _env->ReleaseByteArrayElements(data, ptr, 0);
+}
+
+static void
nAllocationRead_f(JNIEnv *_env, jobject _this, RsContext con, jint alloc, jfloatArray data)
{
jint len = _env->GetArrayLength(data);
@@ -1216,8 +1258,12 @@ static JNINativeMethod methods[] = {
{"rsnAllocationData1D", "(IIIII[FI)V", (void*)nAllocationData1D_f },
{"rsnAllocationElementData1D", "(IIIII[BI)V", (void*)nAllocationElementData1D },
{"rsnAllocationData2D", "(IIIIIIII[II)V", (void*)nAllocationData2D_i },
+{"rsnAllocationData2D", "(IIIIIIII[SI)V", (void*)nAllocationData2D_s },
+{"rsnAllocationData2D", "(IIIIIIII[BI)V", (void*)nAllocationData2D_b },
{"rsnAllocationData2D", "(IIIIIIII[FI)V", (void*)nAllocationData2D_f },
{"rsnAllocationRead", "(II[I)V", (void*)nAllocationRead_i },
+{"rsnAllocationRead", "(II[S)V", (void*)nAllocationRead_s },
+{"rsnAllocationRead", "(II[B)V", (void*)nAllocationRead_b },
{"rsnAllocationRead", "(II[F)V", (void*)nAllocationRead_f },
{"rsnAllocationGetType", "(II)I", (void*)nAllocationGetType},
{"rsnAllocationResize1D", "(III)V", (void*)nAllocationResize1D },