diff options
author | Tim Murray <timmurray@google.com> | 2014-02-03 14:41:21 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-02-03 14:41:21 -0800 |
commit | d39e19eb8af54683d03ae955a5a58fea48a58754 (patch) | |
tree | 0d0e7a62f039fa2a61062e193d4bd3bed30bb239 /rs | |
parent | 16e9362e5f5b4f09a46198218380bb386fee28e5 (diff) | |
parent | 351879df3aff02987a6f4c4485bf004a96fcb150 (diff) | |
download | frameworks_base-d39e19eb8af54683d03ae955a5a58fea48a58754.zip frameworks_base-d39e19eb8af54683d03ae955a5a58fea48a58754.tar.gz frameworks_base-d39e19eb8af54683d03ae955a5a58fea48a58754.tar.bz2 |
am 351879df: Merge "Fix getBytesSize for YUV allocations."
* commit '351879df3aff02987a6f4c4485bf004a96fcb150':
Fix getBytesSize for YUV allocations.
Diffstat (limited to 'rs')
-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 98fabce..67d94f9 100644 --- a/rs/java/android/renderscript/Allocation.java +++ b/rs/java/android/renderscript/Allocation.java @@ -223,6 +223,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(); } |