summaryrefslogtreecommitdiff
path: root/rs
diff options
context:
space:
mode:
authorYang Ni <yangni@google.com>2016-01-07 14:57:16 -0800
committerYang Ni <yangni@google.com>2016-03-03 08:47:33 -0800
commit972a409a3df6f105aa99a3d721e37111c70ef44c (patch)
tree32015e72e0fff606d47d5b8517996addfc4d4b77 /rs
parent352fcaeb2067ee488d69e4da192fa4b96ee78bd8 (diff)
Set flags in RS JNI calls for rsObj creation
Bug: 25570907 Added a flag to all RS runtime API for rsObj creation to indicate a call is from Java. This flag will help us avoid incrementing the user ref count for rsObj's created from Single-Source RS, and therefore avoid memory leaks for such objects. Change-Id: Id3604f93b166089e3aca896d1c6c509b3ea19bcf (cherry picked from commit ad88055821a7aba3318f066c4e5f87bd0315462c)
Diffstat (limited to 'rs')
-rw-r--r--rs/jni/android_renderscript_RenderScript.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/rs/jni/android_renderscript_RenderScript.cpp b/rs/jni/android_renderscript_RenderScript.cpp
index 3bef19e01e8e..316e5302deb2 100644
--- a/rs/jni/android_renderscript_RenderScript.cpp
+++ b/rs/jni/android_renderscript_RenderScript.cpp
@@ -1061,7 +1061,7 @@ nElementCreate(JNIEnv *_env, jobject _this, jlong con, jlong type, jint kind, jb
type, kind, norm, size);
}
return (jlong)(uintptr_t)rsElementCreate((RsContext)con, (RsDataType)type, (RsDataKind)kind,
- norm, size);
+ norm, size, true);
}
static jlong
@@ -1100,7 +1100,7 @@ nElementCreate2(JNIEnv *_env, jobject _this, jlong con,
jlong id = (jlong)(uintptr_t)rsElementCreate2((RsContext)con,
(const RsElement *)ids, fieldCount,
nameArray, fieldCount * sizeof(size_t), sizeArray,
- (const uint32_t *)arraySizes, fieldCount);
+ (const uint32_t *)arraySizes, fieldCount, true);
free(ids);
free(arraySizes);
@@ -1174,7 +1174,7 @@ nTypeCreate(JNIEnv *_env, jobject _this, jlong con, jlong eid,
}
return (jlong)(uintptr_t)rsTypeCreate((RsContext)con, (RsElement)eid, dimx, dimy, dimz, mips,
- faces, yuv);
+ faces, yuv, true);
}
static void
@@ -1210,7 +1210,7 @@ nAllocationCreateTyped(JNIEnv *_env, jobject _this, jlong con, jlong type, jint
}
return (jlong)(uintptr_t) rsAllocationCreateTyped((RsContext)con, (RsType)type,
(RsAllocationMipmapControl)mips,
- (uint32_t)usage, (uintptr_t)pointer);
+ (uint32_t)usage, (uintptr_t)pointer, true);
}
static void
@@ -1315,7 +1315,7 @@ nAllocationCreateFromBitmap(JNIEnv *_env, jobject _this, jlong con, jlong type,
const void* ptr = bitmap.getPixels();
jlong id = (jlong)(uintptr_t)rsAllocationCreateFromBitmap((RsContext)con,
(RsType)type, (RsAllocationMipmapControl)mip,
- ptr, bitmap.getSize(), usage);
+ ptr, bitmap.getSize(), usage, true);
bitmap.unlockPixels();
return id;
}
@@ -1331,7 +1331,7 @@ nAllocationCreateBitmapBackedAllocation(JNIEnv *_env, jobject _this, jlong con,
const void* ptr = bitmap.getPixels();
jlong id = (jlong)(uintptr_t)rsAllocationCreateTyped((RsContext)con,
(RsType)type, (RsAllocationMipmapControl)mip,
- (uint32_t)usage, (uintptr_t)ptr);
+ (uint32_t)usage, (uintptr_t)ptr, true);
bitmap.unlockPixels();
return id;
}
@@ -1347,7 +1347,7 @@ nAllocationCubeCreateFromBitmap(JNIEnv *_env, jobject _this, jlong con, jlong ty
const void* ptr = bitmap.getPixels();
jlong id = (jlong)(uintptr_t)rsAllocationCubeCreateFromBitmap((RsContext)con,
(RsType)type, (RsAllocationMipmapControl)mip,
- ptr, bitmap.getSize(), usage);
+ ptr, bitmap.getSize(), usage, true);
bitmap.unlockPixels();
return id;
}