Merge "[RenderScript] fix Allocation.copyToFieldPacker"

This commit is contained in:
Miao Wang
2015-05-19 16:45:07 +00:00
committed by Gerrit Code Review
2 changed files with 2 additions and 2 deletions

View File

@ -1448,7 +1448,7 @@ public class Allocation extends BaseObj {
} }
final byte[] data = fp.getData(); final byte[] data = fp.getData();
int data_length = fp.getPos(); int data_length = data.length;
int eSize = mType.mElement.mElements[component_number].getBytesSize(); int eSize = mType.mElement.mElements[component_number].getBytesSize();
eSize *= mType.mElement.mArraySizes[component_number]; eSize *= mType.mElement.mArraySizes[component_number];

View File

@ -1462,7 +1462,7 @@ nAllocationElementRead(JNIEnv *_env, jobject _this, jlong con, jlong alloc,
rsAllocationElementRead((RsContext)con, (RsAllocation)alloc, rsAllocationElementRead((RsContext)con, (RsAllocation)alloc,
xoff, yoff, zoff, xoff, yoff, zoff,
lod, ptr, sizeBytes, compIdx); lod, ptr, sizeBytes, compIdx);
_env->ReleaseByteArrayElements(data, ptr, JNI_ABORT); _env->ReleaseByteArrayElements(data, ptr, 0);
} }
// Copies from the Allocation pointed to by _alloc into the Java object data. // Copies from the Allocation pointed to by _alloc into the Java object data.