diff options
author | Jason Sams <jsams@google.com> | 2013-04-13 19:48:36 -0700 |
---|---|---|
committer | Jason Sams <jsams@google.com> | 2013-04-14 02:56:03 +0000 |
commit | 9bf189228fdb0ec14b284f8bd543d5f9137997cc (patch) | |
tree | be5ebeea9340aa4c718cae968e34d3d9cab34e8e /graphics/java/android/renderscript/Allocation.java | |
parent | 02d56d90e01e20db8424de94a14fe59dc94f19c0 (diff) |
Revert GC thread changes
This is not quite a straight revery, some manual edits were necessary.
The original CL didn't undergo sufficient design review or testing. Revert until the regressions can be sorted out.
Bug 8585185
This reverts commit 6dacf8355a0692b52c49f603f43317772cb36175
This reverts commit f8c033db1edf36a0ab09568c3142054f0be2d1a1
Change-Id: Ie7215bdf881332e822603547e92f810f595077fc
Diffstat (limited to 'graphics/java/android/renderscript/Allocation.java')
-rw-r--r-- | graphics/java/android/renderscript/Allocation.java | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/graphics/java/android/renderscript/Allocation.java b/graphics/java/android/renderscript/Allocation.java index ea29b7dc49cc..5d1990a4b85e 100644 --- a/graphics/java/android/renderscript/Allocation.java +++ b/graphics/java/android/renderscript/Allocation.java @@ -277,21 +277,13 @@ public class Allocation extends BaseObj { throw new RSIllegalArgumentException("Invalid usage combination."); } } - if (t != null) { - // don't need to account for USAGE_SHARED Allocations - if ((usage & USAGE_SHARED) == 0) { - int numBytes = t.getCount() * t.getElement().getBytesSize(); - rs.addAllocSizeForGC(numBytes); - mGCSize = numBytes; - } - } + mType = t; mUsage = usage; if (t != null) { updateCacheInfo(t); } - } private void validateIsInt32() { @@ -355,12 +347,6 @@ public class Allocation extends BaseObj { mType.updateFromNative(); updateCacheInfo(mType); } - // don't need to account for USAGE_SHARED Allocations - if ((mUsage & USAGE_SHARED) == 0) { - int numBytes = mType.getCount() * mType.getElement().getBytesSize(); - mRS.addAllocSizeForGC(numBytes); - mGCSize = numBytes; - } } /** @@ -1264,7 +1250,6 @@ public class Allocation extends BaseObj { if (type.getID(rs) == 0) { throw new RSInvalidStateException("Bad Type"); } - int id = rs.nAllocationCreateTyped(type.getID(rs), mips.mID, usage, 0); if (id == 0) { throw new RSRuntimeException("Allocation creation failed."); @@ -1414,6 +1399,7 @@ public class Allocation extends BaseObj { return alloc; } + int id = rs.nAllocationCreateFromBitmap(t.getID(rs), mips.mID, b, usage); if (id == 0) { throw new RSRuntimeException("Load failed."); |