diff options
author | Alex Sakhartchouk <alexst@google.com> | 2011-06-14 11:13:19 -0700 |
---|---|---|
committer | Alex Sakhartchouk <alexst@google.com> | 2011-06-14 11:13:19 -0700 |
commit | 304b1f5497155bcf91e7b855cfab7a675e80bf26 (patch) | |
tree | 3a73f3855d29591f9b74f4967d594ec2476262b1 /graphics/jni | |
parent | bd3e537980027f4502a13c204b3c7b9d10adad31 (diff) | |
download | frameworks_base-304b1f5497155bcf91e7b855cfab7a675e80bf26.zip frameworks_base-304b1f5497155bcf91e7b855cfab7a675e80bf26.tar.gz frameworks_base-304b1f5497155bcf91e7b855cfab7a675e80bf26.tar.bz2 |
Allocation copy functions.
Change-Id: Idce6d44a4f4bb2e399284a40c0f90dc1bff912fd
Diffstat (limited to 'graphics/jni')
-rw-r--r-- | graphics/jni/android_renderscript_RenderScript.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
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 }, |