Rough implemetation of ForEach.
Remove launchID from root graphics script.

Change-Id: I9f80c0d4df1264f2ee1624a6d7216b9dfdf8502e
diff --git a/rsScriptC_Lib.cpp b/rsScriptC_Lib.cpp
index 0c10fca..3f3ff23 100644
--- a/rsScriptC_Lib.cpp
+++ b/rsScriptC_Lib.cpp
@@ -540,7 +540,7 @@
 static void SC_scriptCall(int scriptID)
 {
     GET_TLS();
-    rsc->runScript((Script *)scriptID, 0);
+    rsc->runScript((Script *)scriptID);
 }
 
 int SC_divsi3(int a, int b)
@@ -556,6 +556,58 @@
 }
 
 
+void SC_ForEachii(RsScript vs, RsAllocation vin)
+{
+    GET_TLS();
+    Script *s = static_cast<Script *>(vs);
+    Allocation *ain = static_cast<Allocation *>(vin);
+    s->runForEach(rsc, ain, NULL);
+}
+
+void SC_ForEachiii(RsScript vs, RsAllocation vin, RsAllocation vout)
+{
+    GET_TLS();
+    Script *s = static_cast<Script *>(vs);
+    Allocation *ain = static_cast<Allocation *>(vin);
+    Allocation *aout = static_cast<Allocation *>(vout);
+    s->runForEach(rsc, ain, aout);
+}
+
+void SC_ForEachiiii(RsScript vs, RsAllocation vin, int xStart, int xEnd)
+{
+    GET_TLS();
+    Script *s = static_cast<Script *>(vs);
+    Allocation *ain = static_cast<Allocation *>(vin);
+    s->runForEach(rsc, ain, NULL, xStart, xEnd);
+}
+
+void SC_ForEachiiiii(RsScript vs, RsAllocation vin, RsAllocation vout, int xStart, int xEnd)
+{
+    GET_TLS();
+    Script *s = static_cast<Script *>(vs);
+    Allocation *ain = static_cast<Allocation *>(vin);
+    Allocation *aout = static_cast<Allocation *>(vout);
+    s->runForEach(rsc, ain, aout, xStart, xEnd);
+}
+
+void SC_ForEachiiiiii(RsScript vs, RsAllocation vin, int xStart, int yStart, int xEnd, int yEnd)
+{
+    GET_TLS();
+    Script *s = static_cast<Script *>(vs);
+    Allocation *ain = static_cast<Allocation *>(vin);
+    s->runForEach(rsc, ain, NULL, xStart, yStart, xEnd, yEnd);
+}
+
+void SC_ForEachiiiiiii(RsScript vs, RsAllocation vin, RsAllocation vout, int xStart, int yStart, int xEnd, int yEnd)
+{
+    GET_TLS();
+    Script *s = static_cast<Script *>(vs);
+    Allocation *ain = static_cast<Allocation *>(vin);
+    Allocation *aout = static_cast<Allocation *>(vout);
+    s->runForEach(rsc, ain, aout, xStart, yStart, xEnd, yEnd);
+}
+
+
 //////////////////////////////////////////////////////////////////////////////
 // Class implementation
 //////////////////////////////////////////////////////////////////////////////
@@ -640,6 +692,12 @@
     { "rsMatrixScale", (void *)&SC_matrixScale },
     { "rsMatrixTranslate", (void *)&SC_matrixTranslate },
 
+    { "_Z9rsForEachii", (void *)&SC_ForEachii },
+    { "_Z9rsForEachiii", (void *)&SC_ForEachiii },
+    { "_Z9rsForEachiiii", (void *)&SC_ForEachiiii },
+    { "_Z9rsForEachiiiii", (void *)&SC_ForEachiiiii },
+    { "_Z9rsForEachiiiiii", (void *)&SC_ForEachiiiiii },
+    { "_Z9rsForEachiiiiiii", (void *)&SC_ForEachiiiiiii },
 
 ////////////////////////////////////////////////////////////////////