summaryrefslogtreecommitdiffstats
path: root/rs
diff options
context:
space:
mode:
authorYang Ni <yangni@google.com>2015-05-11 21:14:31 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-05-11 21:14:32 +0000
commit552518e3c1241f643e3324f26fcc8f6d5bbde3d7 (patch)
treeacfc9e64ce23c214d747adc2edbe351c9cf6a982 /rs
parentcb556e0d25d4be11f5441c9b23c96633cfd4ca95 (diff)
parent9310e3db455d863cd6d99076120c9e3ae99dee2e (diff)
downloadframeworks_base-552518e3c1241f643e3324f26fcc8f6d5bbde3d7.zip
frameworks_base-552518e3c1241f643e3324f26fcc8f6d5bbde3d7.tar.gz
frameworks_base-552518e3c1241f643e3324f26fcc8f6d5bbde3d7.tar.bz2
Merge "Moved limit constants for kernel and script group" into mnc-dev
Diffstat (limited to 'rs')
-rw-r--r--rs/jni/android_renderscript_RenderScript.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/rs/jni/android_renderscript_RenderScript.cpp b/rs/jni/android_renderscript_RenderScript.cpp
index a49fb76..1833a1c 100644
--- a/rs/jni/android_renderscript_RenderScript.cpp
+++ b/rs/jni/android_renderscript_RenderScript.cpp
@@ -43,9 +43,6 @@
//#define LOG_API ALOGE
static constexpr bool kLogApi = false;
-static constexpr size_t kMaxNumberArgsAndBindings = 1000;
-static constexpr size_t kMaxNumberClosuresInScriptGroup = 1000000;
-static constexpr size_t kMaxNumberKernelArguments = 256;
using namespace android;
@@ -371,7 +368,7 @@ nClosureCreate(JNIEnv *_env, jobject _this, jlong con, jlong kernelID,
goto exit;
}
- if (numValues > kMaxNumberArgsAndBindings) {
+ if (numValues > RS_CLOSURE_MAX_NUMBER_ARGS_AND_BINDINGS) {
ALOGE("Too many arguments or globals in closure creation");
goto exit;
}
@@ -456,7 +453,7 @@ nInvokeClosureCreate(JNIEnv *_env, jobject _this, jlong con, jlong invokeID,
numValues = (size_t) fieldIDs_length;
- if (numValues > kMaxNumberArgsAndBindings) {
+ if (numValues > RS_CLOSURE_MAX_NUMBER_ARGS_AND_BINDINGS) {
ALOGE("Too many arguments or globals in closure creation");
goto exit;
}
@@ -521,7 +518,7 @@ nScriptGroup2Create(JNIEnv *_env, jobject _this, jlong con, jstring name,
RsClosure* closures;
- if (numClosures > (jsize) kMaxNumberClosuresInScriptGroup) {
+ if (numClosures > (jsize) RS_SCRIPT_GROUP_MAX_NUMBER_CLOSURES) {
ALOGE("Too many closures in script group");
goto exit;
}
@@ -1867,7 +1864,7 @@ nScriptForEach(JNIEnv *_env, jobject _this, jlong con, jlong script, jint slot,
if (ains != nullptr) {
in_len = _env->GetArrayLength(ains);
- if (in_len > (jint)kMaxNumberKernelArguments) {
+ if (in_len > (jint)RS_KERNEL_MAX_ARGUMENTS) {
ALOGE("Too many arguments in kernel launch.");
// TODO (b/20758983): Report back to Java and throw an exception
return;