commit | 04f0d6e3394ed8518db51307a9b66f9b44477a46 | [log] [tgz] |
---|---|---|
author | Tim Murray <timmurray@google.com> | Tue Dec 17 17:15:25 2013 -0800 |
committer | Tim Murray <timmurray@google.com> | Tue Jan 07 11:14:39 2014 -0800 |
tree | 0eb3257b2aab83bfb2411e9a6d8eff5944a2aea2 | |
parent | c975437ef3338ba38b76b1a07594ccfd6e089709 [diff] |
Fix getBytesSize for YUV allocations. bug 12134914 Change-Id: I128e75b756a5bd129077177e254f1db6c94182f1
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 int getBytesSize() { + if (mType.mDimYuv != 0) { + return (int)Math.ceil(mType.getCount() * mType.getElement().getBytesSize() * 1.5); + } return mType.getCount() * mType.getElement().getBytesSize(); }