summaryrefslogtreecommitdiff
path: root/graphics/java/android/renderscript/Program.java
diff options
context:
space:
mode:
authorJason Sams <jsams@google.com>2012-04-03 15:36:36 -0700
committerJason Sams <jsams@google.com>2012-04-03 15:36:36 -0700
commite07694b24f7d12d72b084b6651356681ebd0efd6 (patch)
treee5cbb853579a105f5910c1c6640358e0cf69b5d9 /graphics/java/android/renderscript/Program.java
parent991c8733c3b990b88edf5cf223aebe3d1c71b7f0 (diff)
Validate context when using RS objects.
BUG=6035422 Change-Id: I8586be0085b36767289e1f634111c0ff076cec3c
Diffstat (limited to 'graphics/java/android/renderscript/Program.java')
-rw-r--r--graphics/java/android/renderscript/Program.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/graphics/java/android/renderscript/Program.java b/graphics/java/android/renderscript/Program.java
index 4d60ac860621..104d1cd9b407 100644
--- a/graphics/java/android/renderscript/Program.java
+++ b/graphics/java/android/renderscript/Program.java
@@ -134,11 +134,11 @@ public class Program extends BaseObj {
throw new IllegalArgumentException("Slot ID out of range.");
}
if (a != null &&
- a.getType().getID() != mConstants[slot].getID()) {
+ a.getType().getID(mRS) != mConstants[slot].getID(mRS)) {
throw new IllegalArgumentException("Allocation type does not match slot type.");
}
- int id = a != null ? a.getID() : 0;
- mRS.nProgramBindConstants(getID(), slot, id);
+ int id = a != null ? a.getID(mRS) : 0;
+ mRS.nProgramBindConstants(getID(mRS), slot, id);
}
/**
@@ -159,8 +159,8 @@ public class Program extends BaseObj {
throw new IllegalArgumentException("Cannot bind cubemap to 2d texture slot");
}
- int id = va != null ? va.getID() : 0;
- mRS.nProgramBindTexture(getID(), slot, id);
+ int id = va != null ? va.getID(mRS) : 0;
+ mRS.nProgramBindTexture(getID(mRS), slot, id);
}
/**
@@ -179,8 +179,8 @@ public class Program extends BaseObj {
throw new IllegalArgumentException("Slot ID out of range.");
}
- int id = vs != null ? vs.getID() : 0;
- mRS.nProgramBindSampler(getID(), slot, id);
+ int id = vs != null ? vs.getID(mRS) : 0;
+ mRS.nProgramBindSampler(getID(mRS), slot, id);
}