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

* commit '4fea742c07d2d55f29b7d61078914c5f83817313':
  Update copyFrom(BaseObj[]) for large objects.
This commit is contained in:
Stephen Hines
2014-07-10 00:16:44 +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
if (RenderScript.sPointerSize == 8) {
long i[] = new long[d.length * 4];
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]; int i[] = new int[d.length];
for (int ct=0; ct < d.length; ct++) { for (int ct=0; ct < d.length; ct++) {
i[ct] = (int)d[ct].getID(mRS); 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);
} }