diff options
author | Jason Sams <jsams@google.com> | 2013-02-22 12:45:54 -0800 |
---|---|---|
committer | Jason Sams <jsams@google.com> | 2013-02-22 12:45:54 -0800 |
commit | 72226e0543461133b9e177a3e78ae50b0c65e797 (patch) | |
tree | 6d86fb635d269961fd5ee1684187c0360b473164 /graphics/java/android/renderscript/Allocation.java | |
parent | ec6156f9e884ba85c76a9c4683f83f18b3f64afa (diff) |
Implement USAGE_IO_INPUT
Change-Id: Id5b9e3d0a17e4df15eec36d542fde6dc626138b2
Diffstat (limited to 'graphics/java/android/renderscript/Allocation.java')
-rw-r--r-- | graphics/java/android/renderscript/Allocation.java | 36 |
1 files changed, 4 insertions, 32 deletions
diff --git a/graphics/java/android/renderscript/Allocation.java b/graphics/java/android/renderscript/Allocation.java index 1c83c51e377d..2f3e48c7ba9f 100644 --- a/graphics/java/android/renderscript/Allocation.java +++ b/graphics/java/android/renderscript/Allocation.java @@ -1246,24 +1246,6 @@ public class Allocation extends BaseObj { } /** - * - * - * @hide - * - */ - public SurfaceTexture getSurfaceTexture() { - if ((mUsage & USAGE_IO_INPUT) == 0) { - throw new RSInvalidStateException("Allocation is not a surface texture."); - } - - int id = mRS.nAllocationGetSurfaceTextureID(getID(mRS)); - SurfaceTexture st = new SurfaceTexture(id); - mRS.nAllocationGetSurfaceTextureID2(getID(mRS), st); - - return st; - } - - /** * For allocations used with io operations, returns the handle * onto a raw buffer that is being managed by the screen * compositor. @@ -1272,7 +1254,10 @@ public class Allocation extends BaseObj { * */ public Surface getSurface() { - return new Surface(getSurfaceTexture()); + if ((mUsage & USAGE_IO_INPUT) == 0) { + throw new RSInvalidStateException("Allocation is not a surface texture."); + } + return mRS.nAllocationGetSurface(getID(mRS)); } /** @@ -1290,19 +1275,6 @@ public class Allocation extends BaseObj { } /** - * @hide - */ - public void setSurfaceTexture(SurfaceTexture st) { - mRS.validate(); - if ((mUsage & USAGE_IO_OUTPUT) == 0) { - throw new RSInvalidStateException("Allocation is not USAGE_IO_OUTPUT."); - } - - Surface s = new Surface(st); - mRS.nAllocationSetSurface(getID(mRS), s); - } - - /** * Creates a RenderScript allocation from a bitmap. * * With target API version 18 or greater, this allocation will be |