From e07694b24f7d12d72b084b6651356681ebd0efd6 Mon Sep 17 00:00:00 2001 From: Jason Sams Date: Tue, 3 Apr 2012 15:36:36 -0700 Subject: Validate context when using RS objects. BUG=6035422 Change-Id: I8586be0085b36767289e1f634111c0ff076cec3c --- graphics/java/android/renderscript/Program.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'graphics/java/android/renderscript/Program.java') 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); } -- cgit v1.2.3