summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Sams <jsams@google.com>2012-03-23 15:48:37 -0700
committerJason Sams <jsams@google.com>2012-03-23 15:48:37 -0700
commit36c0f6465896c1ad2f5e4811c275c6aa9f8ae874 (patch)
tree9208835192b43c87bf753a42bf8f113c6155b38f
parent03d2d00dc8ce40528d232fdf81eb0b05e92023a7 (diff)
downloadframeworks_base-36c0f6465896c1ad2f5e4811c275c6aa9f8ae874.zip
frameworks_base-36c0f6465896c1ad2f5e4811c275c6aa9f8ae874.tar.gz
frameworks_base-36c0f6465896c1ad2f5e4811c275c6aa9f8ae874.tar.bz2
Add getSizeBytes and cleanup docs.
Change-Id: I854a41f50378590b58bfbb205906ed4bee440411
-rw-r--r--graphics/java/android/renderscript/Allocation.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/graphics/java/android/renderscript/Allocation.java b/graphics/java/android/renderscript/Allocation.java
index 5a54647..a76a628 100644
--- a/graphics/java/android/renderscript/Allocation.java
+++ b/graphics/java/android/renderscript/Allocation.java
@@ -211,6 +211,17 @@ public class Allocation extends BaseObj {
return mUsage;
}
+ /**
+ * Get the size of the Allocation in bytes.
+ *
+ * @hide
+ * @return sizeInBytes
+ *
+ */
+ public int getSizeBytes() {
+ return mType.getCount() * mType.getElement().getSizeBytes();
+ }
+
private void updateCacheInfo(Type t) {
mCurrentDimX = t.getX();
mCurrentDimY = t.getY();
@@ -328,7 +339,7 @@ public class Allocation extends BaseObj {
}
/**
- * Propogate changes from one usage of the allocation to the
+ * Propagate changes from one usage of the allocation to the
* remaining usages of the allocation.
*
*/
@@ -378,7 +389,7 @@ public class Allocation extends BaseObj {
}
/**
- * Copy an array of RS objects to the allocation
+ * Copy an array of RS objects to the allocation.
*
* @param d Source array.
*/