summaryrefslogtreecommitdiffstats
path: root/rs/java
diff options
context:
space:
mode:
authorTim Murray <timmurray@google.com>2013-12-17 17:15:25 -0800
committerTim Murray <timmurray@google.com>2014-01-07 11:14:39 -0800
commit04f0d6e3394ed8518db51307a9b66f9b44477a46 (patch)
tree0eb3257b2aab83bfb2411e9a6d8eff5944a2aea2 /rs/java
parentc975437ef3338ba38b76b1a07594ccfd6e089709 (diff)
downloadframeworks_base-04f0d6e3394ed8518db51307a9b66f9b44477a46.zip
frameworks_base-04f0d6e3394ed8518db51307a9b66f9b44477a46.tar.gz
frameworks_base-04f0d6e3394ed8518db51307a9b66f9b44477a46.tar.bz2
Fix getBytesSize for YUV allocations.
bug 12134914 Change-Id: I128e75b756a5bd129077177e254f1db6c94182f1
Diffstat (limited to 'rs/java')
-rw-r--r--rs/java/android/renderscript/Allocation.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/rs/java/android/renderscript/Allocation.java b/rs/java/android/renderscript/Allocation.java
index 45dd25a..2191b54 100644
--- a/rs/java/android/renderscript/Allocation.java
+++ b/rs/java/android/renderscript/Allocation.java
@@ -278,6 +278,9 @@ public class Allocation extends BaseObj {
*
*/
public int getBytesSize() {
+ if (mType.mDimYuv != 0) {
+ return (int)Math.ceil(mType.getCount() * mType.getElement().getBytesSize() * 1.5);
+ }
return mType.getCount() * mType.getElement().getBytesSize();
}