Merge "Update copyFrom(BaseObj[]) for large objects."

This commit is contained in:
Stephen Hines
2014-07-10 00:10:05 +00:00
committed by Gerrit Code Review

View File

@@ -518,13 +518,20 @@ public class Allocation extends BaseObj {
throw new RSIllegalArgumentException("Array size mismatch, allocation sizeX = " + throw new RSIllegalArgumentException("Array size mismatch, allocation sizeX = " +
mCurrentCount + ", array length = " + d.length); mCurrentCount + ", array length = " + d.length);
} }
// FIXME: requires 64-bit path
int i[] = new int[d.length]; if (RenderScript.sPointerSize == 8) {
for (int ct=0; ct < d.length; ct++) { long i[] = new long[d.length * 4];
i[ct] = (int)d[ct].getID(mRS); for (int ct=0; ct < d.length; ct++) {
i[ct * 4] = d[ct].getID(mRS);
}
copy1DRangeFromUnchecked(0, mCurrentCount, i);
} else {
int i[] = new int[d.length];
for (int ct=0; ct < d.length; ct++) {
i[ct] = (int)d[ct].getID(mRS);
}
copy1DRangeFromUnchecked(0, mCurrentCount, i);
} }
copy1DRangeFromUnchecked(0, mCurrentCount, i);
Trace.traceEnd(RenderScript.TRACE_TAG); Trace.traceEnd(RenderScript.TRACE_TAG);
} }