summaryrefslogtreecommitdiff
path: root/rs/java/android/renderscript/Allocation.java
diff options
context:
space:
mode:
authorMiao Wang <miaowang@google.com>2015-02-05 00:01:29 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-02-05 00:03:05 +0000
commit9a55cbc0523bb05f15a1ea252c6736ce5060c53e (patch)
tree12869ff6fafb696963e7f4ec629f85d5e6b61445 /rs/java/android/renderscript/Allocation.java
parent5ad36d4591e7b3b1b74f0a213d18384f53734ab2 (diff)
parentf0f6e80baee176b4608402d067a75c45be18d553 (diff)
Merge "make Allocation.destroy() include setSurface(null) for USAGE_IO_OUTPUT (Native RS)"
Diffstat (limited to 'rs/java/android/renderscript/Allocation.java')
-rw-r--r--rs/java/android/renderscript/Allocation.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/rs/java/android/renderscript/Allocation.java b/rs/java/android/renderscript/Allocation.java
index 3cda6de14ff5..69103e872654 100644
--- a/rs/java/android/renderscript/Allocation.java
+++ b/rs/java/android/renderscript/Allocation.java
@@ -1878,4 +1878,15 @@ public class Allocation extends BaseObj {
}
}
+ /**
+ * For USAGE_IO_OUTPUT, destroy() implies setSurface(null).
+ *
+ */
+ @Override
+ public void destroy() {
+ if((mUsage & USAGE_IO_OUTPUT) != 0) {
+ setSurface(null);
+ }
+ super.destroy();
+ }
}