From e6eaaf6a8e491404c33aab5cd70444d2637df1bc Mon Sep 17 00:00:00 2001 From: Tim Murray Date: Tue, 17 Dec 2013 17:15:25 -0800 Subject: Fix getBytesSize for YUV allocations. bug 12134914 Change-Id: I128e75b756a5bd129077177e254f1db6c94182f1 --- rs/java/android/renderscript/Allocation.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'rs/java') 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(); } -- cgit v1.1