diff options
author | Tim Murray <timmurray@google.com> | 2013-12-17 17:15:25 -0800 |
---|---|---|
committer | Tim Murray <timmurray@google.com> | 2014-01-07 11:14:39 -0800 |
commit | 04f0d6e3394ed8518db51307a9b66f9b44477a46 (patch) | |
tree | 0eb3257b2aab83bfb2411e9a6d8eff5944a2aea2 /rs/java | |
parent | c975437ef3338ba38b76b1a07594ccfd6e089709 (diff) | |
download | frameworks_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.java | 3 |
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(); } |