summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rs/java/android/renderscript/Allocation.java2
-rw-r--r--rs/java/android/renderscript/RenderScript.java7
2 files changed, 7 insertions, 2 deletions
diff --git a/rs/java/android/renderscript/Allocation.java b/rs/java/android/renderscript/Allocation.java
index 7db85f2..3cda6de 100644
--- a/rs/java/android/renderscript/Allocation.java
+++ b/rs/java/android/renderscript/Allocation.java
@@ -1868,7 +1868,7 @@ public class Allocation extends BaseObj {
}
}
- static void sendBufferNotification(int id) {
+ static void sendBufferNotification(long id) {
synchronized(mAllocationMap) {
Allocation a = mAllocationMap.get(new Long(id));
diff --git a/rs/java/android/renderscript/RenderScript.java b/rs/java/android/renderscript/RenderScript.java
index 340efef..6c5c508 100644
--- a/rs/java/android/renderscript/RenderScript.java
+++ b/rs/java/android/renderscript/RenderScript.java
@@ -1156,7 +1156,12 @@ public class RenderScript {
}
if (msg == RS_MESSAGE_TO_CLIENT_NEW_BUFFER) {
- Allocation.sendBufferNotification(subID);
+ if (mRS.nContextGetUserMessage(mRS.mContext, rbuf) !=
+ RS_MESSAGE_TO_CLIENT_NEW_BUFFER) {
+ throw new RSDriverException("Error processing message from RenderScript.");
+ }
+ long bufferID = ((long)rbuf[1] << 32L) + ((long)rbuf[0] & 0xffffffffL);
+ Allocation.sendBufferNotification(bufferID);
continue;
}