am 8348c351: am 4fea742c: Merge "Update copyFrom(BaseObj[]) for large objects."

* commit '8348c35165001cdb16c73f077be257f653392535':
  Update copyFrom(BaseObj[]) for large objects.
This commit is contained in:
Stephen Hines
2014-07-10 00:21:50 +00:00
committed by Android Git Automerger

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);
} }