diff options
author | Tim Murray <timmurray@google.com> | 2014-07-01 16:56:18 -0700 |
---|---|---|
committer | Tim Murray <timmurray@google.com> | 2014-07-09 15:30:42 -0700 |
commit | 3de3dc79e569bac3205e9af1ffe726964b845358 (patch) | |
tree | adc639d477299df59b0aeb4379f6bba0d41503bd /rs/java/android/renderscript/Allocation.java | |
parent | dbbf07a5c7f514f2168f236e1df3b2ca70d4ab2f (diff) | |
download | frameworks_base-3de3dc79e569bac3205e9af1ffe726964b845358.zip frameworks_base-3de3dc79e569bac3205e9af1ffe726964b845358.tar.gz frameworks_base-3de3dc79e569bac3205e9af1ffe726964b845358.tar.bz2 |
Update copyFrom(BaseObj[]) for large objects.
Change-Id: I99cadbd1ad925cad0dd357c9abbd1a49c07785c9
Diffstat (limited to 'rs/java/android/renderscript/Allocation.java')
-rw-r--r-- | rs/java/android/renderscript/Allocation.java | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/rs/java/android/renderscript/Allocation.java b/rs/java/android/renderscript/Allocation.java index d9588e8..ac76ddf 100644 --- a/rs/java/android/renderscript/Allocation.java +++ b/rs/java/android/renderscript/Allocation.java @@ -514,13 +514,20 @@ public class Allocation extends BaseObj { throw new RSIllegalArgumentException("Array size mismatch, allocation sizeX = " + mCurrentCount + ", array length = " + d.length); } - // FIXME: requires 64-bit path - int i[] = new int[d.length]; - for (int ct=0; ct < d.length; ct++) { - i[ct] = (int)d[ct].getID(mRS); + 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]; + 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); } |