From 304b1f5497155bcf91e7b855cfab7a675e80bf26 Mon Sep 17 00:00:00 2001 From: Alex Sakhartchouk Date: Tue, 14 Jun 2011 11:13:19 -0700 Subject: Allocation copy functions. Change-Id: Idce6d44a4f4bb2e399284a40c0f90dc1bff912fd --- graphics/jni/android_renderscript_RenderScript.cpp | 27 +++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'graphics/jni') diff --git a/graphics/jni/android_renderscript_RenderScript.cpp b/graphics/jni/android_renderscript_RenderScript.cpp index 60b39b0..7e53cc4 100644 --- a/graphics/jni/android_renderscript_RenderScript.cpp +++ b/graphics/jni/android_renderscript_RenderScript.cpp @@ -468,7 +468,7 @@ nAllocationCopyFromBitmap(JNIEnv *_env, jobject _this, RsContext con, jint alloc bitmap.lockPixels(); const void* ptr = bitmap.getPixels(); rsAllocation2DData(con, (RsAllocation)alloc, 0, 0, - 0, RS_ALLOCATION_CUBMAP_FACE_POSITVE_X, + 0, RS_ALLOCATION_CUBEMAP_FACE_POSITIVE_X, w, h, ptr, bitmap.getSize()); bitmap.unlockPixels(); } @@ -589,6 +589,30 @@ nAllocationData2D_f(JNIEnv *_env, jobject _this, RsContext con, jint alloc, jint } static void +nAllocationData2D_alloc(JNIEnv *_env, jobject _this, RsContext con, + jint dstAlloc, jint dstXoff, jint dstYoff, + jint dstMip, jint dstFace, + jint width, jint height, + jint srcAlloc, jint srcXoff, jint srcYoff, + jint srcMip, jint srcFace) +{ + LOG_API("nAllocation2DData_s, con(%p), dstAlloc(%p), dstXoff, dstYoff," + " dstMip(%i), dstFace(%i), width(%i), height(%i)," + " srcAlloc(%p), srcXoff(%i), srcYoff(%i), srcMip(%i), srcFace(%i)", + con, (RsAllocation)dstAlloc, dstXoff, dstYoff, dstMip, dstFace, + width, height, (RsAllocation)srcAlloc, srcXoff, srcYoff, srcMip, srcFace); + + rsAllocationCopy2DRange(con, + (RsAllocation)dstAlloc, + dstXoff, dstYoff, + dstMip, dstFace, + width, height, + (RsAllocation)srcAlloc, + srcXoff, srcYoff, + srcMip, srcFace); +} + +static void nAllocationRead_i(JNIEnv *_env, jobject _this, RsContext con, jint alloc, jintArray data) { jint len = _env->GetArrayLength(data); @@ -1217,6 +1241,7 @@ static JNINativeMethod methods[] = { {"rsnAllocationData2D", "(IIIIIIII[SI)V", (void*)nAllocationData2D_s }, {"rsnAllocationData2D", "(IIIIIIII[BI)V", (void*)nAllocationData2D_b }, {"rsnAllocationData2D", "(IIIIIIII[FI)V", (void*)nAllocationData2D_f }, +{"rsnAllocationData2D", "(IIIIIIIIIIIII)V", (void*)nAllocationData2D_alloc }, {"rsnAllocationRead", "(II[I)V", (void*)nAllocationRead_i }, {"rsnAllocationRead", "(II[S)V", (void*)nAllocationRead_s }, {"rsnAllocationRead", "(II[B)V", (void*)nAllocationRead_b }, -- cgit v1.1