summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPirama Arumuga Nainar <pirama@google.com>2016-03-01 20:37:19 -0800
committerPirama Arumuga Nainar <pirama@google.com>2016-03-03 16:04:57 -0800
commit1333215d8e61c1cbcabb551ac9a49a801f90ca76 (patch)
tree3096c829b51b640d8b45b75e1a5f3bf67deb57ab
parent5b2a8ab2b476ddb213cce91976b14c0bfd2383f2 (diff)
[RenderScript] Enable untyped variants of Allocation-copy functions for FLOAT_16
http://b/27251511 Handle FLOAT_16 case to PER_ARRAY_TYPE macro to enable untyped variants of Allocation-copy functions. Untyped variants of Allocation-copy functions call validateObjectIsPrimitiveArray(), with checkType parameter set to true, to validate and obtain the Element type of the Allocation. When checkType is true, validateObjectIsPrimitiveArray() returns the actual Element type of the Allocation (instead of the canonical SIGNED type). Because of this, FLOAT_16 element type can reach the JNI layer, necessitating this change to PER_ARRAY_TYPE macro. Change-Id: I3651e5ae0ab0cd6bb4ad3157841e2910ac8699dc (cherry picked from commit 85e8c51dbf8dc774ecfd09981ac6a8bf1b75f464)
-rw-r--r--rs/jni/android_renderscript_RenderScript.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/rs/jni/android_renderscript_RenderScript.cpp b/rs/jni/android_renderscript_RenderScript.cpp
index 316e5302deb2..4877a378aaf4 100644
--- a/rs/jni/android_renderscript_RenderScript.cpp
+++ b/rs/jni/android_renderscript_RenderScript.cpp
@@ -151,6 +151,7 @@ void UNUSED(T... t) {}
return; \
case RS_TYPE_SIGNED_16: \
case RS_TYPE_UNSIGNED_16: \
+ case RS_TYPE_FLOAT_16: \
len = _env->GetArrayLength((jshortArray)data); \
ptr = _env->GetShortArrayElements((jshortArray)data, flag); \
if (ptr == nullptr) { \