Loading graphics/java/android/renderscript/Element.java +3 −2 Original line number Diff line number Diff line /* * Copyright (C) 2008-2012 The Android Open Source Project * Copyright (C) 2013 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Loading Loading @@ -906,7 +906,8 @@ public class Element extends BaseObj { dk == DataKind.PIXEL_LA || dk == DataKind.PIXEL_RGB || dk == DataKind.PIXEL_RGBA || dk == DataKind.PIXEL_DEPTH)) { dk == DataKind.PIXEL_DEPTH || dk == DataKind.PIXEL_YUV)) { throw new RSIllegalArgumentException("Unsupported DataKind"); } if (!(dt == DataType.UNSIGNED_8 || Loading graphics/java/android/renderscript/Type.java +1 −1 Original line number Diff line number Diff line /* * Copyright (C) 2008 The Android Open Source Project * Copyright (C) 2013 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Loading tests/RenderScriptTests/LivePreview/src/com/android/rs/livepreview/RsYuv.java +7 −2 Original line number Diff line number Diff line Loading @@ -80,8 +80,13 @@ public class RsYuv implements TextureView.SurfaceTextureListener Type t = tb.create(); mAllocationOut = Allocation.createTyped(mRS, t, Allocation.USAGE_SCRIPT | Allocation.USAGE_IO_OUTPUT); mAllocationIn = Allocation.createSized(mRS, Element.U8(mRS), (mHeight * mWidth) + ((mHeight / 2) * (mWidth / 2) * 2)); tb = new Type.Builder(mRS, Element.createPixel(mRS, Element.DataType.UNSIGNED_8, Element.DataKind.PIXEL_YUV)); tb.setX(mWidth); tb.setY(mHeight); tb.setYuvFormat(android.graphics.ImageFormat.NV21); mAllocationIn = Allocation.createTyped(mRS, tb.create(), Allocation.USAGE_SCRIPT); mYuv.setInput(mAllocationIn); setupSurface(); Loading Loading
graphics/java/android/renderscript/Element.java +3 −2 Original line number Diff line number Diff line /* * Copyright (C) 2008-2012 The Android Open Source Project * Copyright (C) 2013 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Loading Loading @@ -906,7 +906,8 @@ public class Element extends BaseObj { dk == DataKind.PIXEL_LA || dk == DataKind.PIXEL_RGB || dk == DataKind.PIXEL_RGBA || dk == DataKind.PIXEL_DEPTH)) { dk == DataKind.PIXEL_DEPTH || dk == DataKind.PIXEL_YUV)) { throw new RSIllegalArgumentException("Unsupported DataKind"); } if (!(dt == DataType.UNSIGNED_8 || Loading
graphics/java/android/renderscript/Type.java +1 −1 Original line number Diff line number Diff line /* * Copyright (C) 2008 The Android Open Source Project * Copyright (C) 2013 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. Loading
tests/RenderScriptTests/LivePreview/src/com/android/rs/livepreview/RsYuv.java +7 −2 Original line number Diff line number Diff line Loading @@ -80,8 +80,13 @@ public class RsYuv implements TextureView.SurfaceTextureListener Type t = tb.create(); mAllocationOut = Allocation.createTyped(mRS, t, Allocation.USAGE_SCRIPT | Allocation.USAGE_IO_OUTPUT); mAllocationIn = Allocation.createSized(mRS, Element.U8(mRS), (mHeight * mWidth) + ((mHeight / 2) * (mWidth / 2) * 2)); tb = new Type.Builder(mRS, Element.createPixel(mRS, Element.DataType.UNSIGNED_8, Element.DataKind.PIXEL_YUV)); tb.setX(mWidth); tb.setY(mHeight); tb.setYuvFormat(android.graphics.ImageFormat.NV21); mAllocationIn = Allocation.createTyped(mRS, tb.create(), Allocation.USAGE_SCRIPT); mYuv.setInput(mAllocationIn); setupSurface(); Loading