summaryrefslogtreecommitdiffstats
path: root/rs
diff options
context:
space:
mode:
authorTim Murray <timmurray@google.com>2014-02-03 14:41:21 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2014-02-03 14:41:21 -0800
commitd39e19eb8af54683d03ae955a5a58fea48a58754 (patch)
tree0d0e7a62f039fa2a61062e193d4bd3bed30bb239 /rs
parent16e9362e5f5b4f09a46198218380bb386fee28e5 (diff)
parent351879df3aff02987a6f4c4485bf004a96fcb150 (diff)
downloadframeworks_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.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 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();
}