diff options
author | David Gross <dgross@google.com> | 2016-06-13 17:58:30 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2016-06-13 17:58:32 +0000 |
commit | d749245b88456fcec8be1b93528e179d3a2d61aa (patch) | |
tree | 0f294cf0c00c2694947928edceadb2eabb1443f7 /rs/jni/android_renderscript_RenderScript.cpp | |
parent | 29dbc3cc47a27ae09f0f5aacd778aded427444bc (diff) | |
parent | 4a4578530a1a5fb751ea5a7bfbff83f3ab669895 (diff) |
Merge "Delete simple reduction implementation." into nyc-dev
Diffstat (limited to 'rs/jni/android_renderscript_RenderScript.cpp')
-rw-r--r-- | rs/jni/android_renderscript_RenderScript.cpp | 70 |
1 files changed, 6 insertions, 64 deletions
diff --git a/rs/jni/android_renderscript_RenderScript.cpp b/rs/jni/android_renderscript_RenderScript.cpp index e0f5934cab74..aa2a607dc702 100644 --- a/rs/jni/android_renderscript_RenderScript.cpp +++ b/rs/jni/android_renderscript_RenderScript.cpp @@ -2094,67 +2094,10 @@ nScriptForEach(JNIEnv *_env, jobject _this, jlong con, jlong script, jint slot, static void nScriptReduce(JNIEnv *_env, jobject _this, jlong con, jlong script, jint slot, - jlong ain, jlong aout, jintArray limits) + jlongArray ains, jlong aout, jintArray limits) { if (kLogApi) { - ALOGD("nScriptReduce, con(%p), s(%p), slot(%i) ain(%" PRId64 ") aout(%" PRId64 ")", (RsContext)con, (void *)script, slot, ain, aout); - } - - RsScriptCall sc, *sca = nullptr; - uint32_t sc_size = 0; - - jint limit_len = 0; - jint *limit_ptr = nullptr; - - // If the caller passed limits, reflect them in the RsScriptCall. - if (limits != nullptr) { - limit_len = _env->GetArrayLength(limits); - limit_ptr = _env->GetIntArrayElements(limits, nullptr); - if (limit_ptr == nullptr) { - ALOGE("Failed to get Java array elements"); - return; - } - - // We expect to be passed an array [x1, x2] which specifies - // the sub-range for a 1-dimensional reduction. - assert(limit_len == 2); - UNUSED(limit_len); // As the assert might not be compiled. - - sc.xStart = limit_ptr[0]; - sc.xEnd = limit_ptr[1]; - sc.yStart = 0; - sc.yEnd = 0; - sc.zStart = 0; - sc.zEnd = 0; - sc.strategy = RS_FOR_EACH_STRATEGY_DONT_CARE; - sc.arrayStart = 0; - sc.arrayEnd = 0; - sc.array2Start = 0; - sc.array2End = 0; - sc.array3Start = 0; - sc.array3End = 0; - sc.array4Start = 0; - sc.array4End = 0; - - sca = ≻ - sc_size = sizeof(sc); - } - - rsScriptReduce((RsContext)con, (RsScript)script, slot, - (RsAllocation)ain, (RsAllocation)aout, - sca, sc_size); - - if (limits != nullptr) { - _env->ReleaseIntArrayElements(limits, limit_ptr, JNI_ABORT); - } -} - -static void -nScriptReduceNew(JNIEnv *_env, jobject _this, jlong con, jlong script, jint slot, - jlongArray ains, jlong aout, jintArray limits) -{ - if (kLogApi) { - ALOGD("nScriptReduceNew, con(%p), s(%p), slot(%i) ains(%p) aout(%" PRId64 ")", (RsContext)con, (void *)script, slot, ains, aout); + ALOGD("nScriptReduce, con(%p), s(%p), slot(%i) ains(%p) aout(%" PRId64 ")", (RsContext)con, (void *)script, slot, ains, aout); } if (ains == nullptr) { @@ -2233,9 +2176,9 @@ nScriptReduceNew(JNIEnv *_env, jobject _this, jlong con, jlong script, jint slot sc_size = sizeof(sc); } - rsScriptReduceNew((RsContext)con, (RsScript)script, slot, - in_allocs, in_len, (RsAllocation)aout, - sca, sc_size); + rsScriptReduce((RsContext)con, (RsScript)script, slot, + in_allocs, in_len, (RsAllocation)aout, + sca, sc_size); _env->ReleaseLongArrayElements(ains, in_ptr, JNI_ABORT); @@ -2951,8 +2894,7 @@ static const JNINativeMethod methods[] = { {"rsnScriptInvokeV", "(JJI[B)V", (void*)nScriptInvokeV }, {"rsnScriptForEach", "(JJI[JJ[B[I)V", (void*)nScriptForEach }, -{"rsnScriptReduce", "(JJIJJ[I)V", (void*)nScriptReduce }, -{"rsnScriptReduceNew", "(JJI[JJ[I)V", (void*)nScriptReduceNew }, +{"rsnScriptReduce", "(JJI[JJ[I)V", (void*)nScriptReduce }, {"rsnScriptSetVarI", "(JJII)V", (void*)nScriptSetVarI }, {"rsnScriptGetVarI", "(JJI)I", (void*)nScriptGetVarI }, |