summaryrefslogtreecommitdiffstats
path: root/rs/java
diff options
context:
space:
mode:
authorTim Murray <timmurray@google.com>2014-07-01 16:56:18 -0700
committerStephen Hines <srhines@google.com>2014-07-09 17:09:33 -0700
commit31e12acca54082d1abea57ebe4b5795508d97cb0 (patch)
treead2db4bb766f642fdc5032709a66a38b3f6b4bca /rs/java
parentd74f99d390d9a0e1c800ee68b1bc39c210aca989 (diff)
downloadframeworks_base-31e12acca54082d1abea57ebe4b5795508d97cb0.zip
frameworks_base-31e12acca54082d1abea57ebe4b5795508d97cb0.tar.gz
frameworks_base-31e12acca54082d1abea57ebe4b5795508d97cb0.tar.bz2
Update copyFrom(BaseObj[]) for large objects.
Change-Id: I99cadbd1ad925cad0dd357c9abbd1a49c07785c9
Diffstat (limited to 'rs/java')
-rw-r--r--rs/java/android/renderscript/Allocation.java17
1 files changed, 12 insertions, 5 deletions
diff --git a/rs/java/android/renderscript/Allocation.java b/rs/java/android/renderscript/Allocation.java
index 20b7ee7..cb5df0a 100644
--- a/rs/java/android/renderscript/Allocation.java
+++ b/rs/java/android/renderscript/Allocation.java
@@ -518,13 +518,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);
}