Loading libs/rs/rsScriptC.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include "acc/acc.h" #include "utils/String8.h" #include "utils/Timers.h" #include <GLES/gl.h> #include <GLES/glext.h> Loading Loading @@ -62,6 +63,11 @@ bool ScriptC::run(Context *rsc, uint32_t launchIndex) rsc->setVertex(mEnviroment.mVertex.get()); } if (launchIndex == 0) { mEnviroment.mStartTimeMillis = nanoseconds_to_milliseconds(systemTime(SYSTEM_TIME_MONOTONIC)); } bool ret = false; tls->mScript = this; ret = mProgram.mScript(launchIndex) != 0; Loading libs/rs/rsScriptC_Lib.cpp +31 −6 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ #include "acc/acc.h" #include "utils/String8.h" #include "utils/Timers.h" #include <GLES/gl.h> #include <GLES/glext.h> Loading Loading @@ -261,7 +262,7 @@ static float SC_mapf(float minStart, float minStop, float maxStart, float maxSto // Time routines ////////////////////////////////////////////////////////////////////////////// static uint32_t SC_second() static int32_t SC_second() { GET_TLS(); Loading @@ -279,7 +280,7 @@ static uint32_t SC_second() } } static uint32_t SC_minute() static int32_t SC_minute() { GET_TLS(); Loading @@ -297,7 +298,7 @@ static uint32_t SC_minute() } } static uint32_t SC_hour() static int32_t SC_hour() { GET_TLS(); Loading @@ -315,7 +316,7 @@ static uint32_t SC_hour() } } static uint32_t SC_day() static int32_t SC_day() { GET_TLS(); Loading @@ -333,7 +334,7 @@ static uint32_t SC_day() } } static uint32_t SC_month() static int32_t SC_month() { GET_TLS(); Loading @@ -351,7 +352,7 @@ static uint32_t SC_month() } } static uint32_t SC_year() static int32_t SC_year() { GET_TLS(); Loading @@ -369,6 +370,24 @@ static uint32_t SC_year() } } static int32_t SC_uptimeMillis() { return nanoseconds_to_milliseconds(systemTime(SYSTEM_TIME_MONOTONIC)); } static int32_t SC_startTimeMillis() { GET_TLS(); return sc->mEnviroment.mStartTimeMillis; } static int32_t SC_elapsedTimeMillis() { GET_TLS(); return nanoseconds_to_milliseconds(systemTime(SYSTEM_TIME_MONOTONIC)) - sc->mEnviroment.mStartTimeMillis; } ////////////////////////////////////////////////////////////////////////////// // Matrix routines ////////////////////////////////////////////////////////////////////////////// Loading Loading @@ -895,6 +914,12 @@ ScriptCState::SymbolTable_t ScriptCState::gSyms[] = { "int", "()" }, { "year", (void *)&SC_year, "int", "()" }, { "uptimeMillis", (void*)&SC_uptimeMillis, "int", "()" }, // TODO: use long instead { "startTimeMillis", (void*)&SC_startTimeMillis, "int", "()" }, // TODO: use long instead { "elapsedTimeMillis", (void*)&SC_elapsedTimeMillis, "int", "()" }, // TODO: use long instead // matrix { "matrixLoadIdentity", (void *)&SC_matrixLoadIdentity, Loading Loading
libs/rs/rsScriptC.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include "acc/acc.h" #include "utils/String8.h" #include "utils/Timers.h" #include <GLES/gl.h> #include <GLES/glext.h> Loading Loading @@ -62,6 +63,11 @@ bool ScriptC::run(Context *rsc, uint32_t launchIndex) rsc->setVertex(mEnviroment.mVertex.get()); } if (launchIndex == 0) { mEnviroment.mStartTimeMillis = nanoseconds_to_milliseconds(systemTime(SYSTEM_TIME_MONOTONIC)); } bool ret = false; tls->mScript = this; ret = mProgram.mScript(launchIndex) != 0; Loading
libs/rs/rsScriptC_Lib.cpp +31 −6 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ #include "acc/acc.h" #include "utils/String8.h" #include "utils/Timers.h" #include <GLES/gl.h> #include <GLES/glext.h> Loading Loading @@ -261,7 +262,7 @@ static float SC_mapf(float minStart, float minStop, float maxStart, float maxSto // Time routines ////////////////////////////////////////////////////////////////////////////// static uint32_t SC_second() static int32_t SC_second() { GET_TLS(); Loading @@ -279,7 +280,7 @@ static uint32_t SC_second() } } static uint32_t SC_minute() static int32_t SC_minute() { GET_TLS(); Loading @@ -297,7 +298,7 @@ static uint32_t SC_minute() } } static uint32_t SC_hour() static int32_t SC_hour() { GET_TLS(); Loading @@ -315,7 +316,7 @@ static uint32_t SC_hour() } } static uint32_t SC_day() static int32_t SC_day() { GET_TLS(); Loading @@ -333,7 +334,7 @@ static uint32_t SC_day() } } static uint32_t SC_month() static int32_t SC_month() { GET_TLS(); Loading @@ -351,7 +352,7 @@ static uint32_t SC_month() } } static uint32_t SC_year() static int32_t SC_year() { GET_TLS(); Loading @@ -369,6 +370,24 @@ static uint32_t SC_year() } } static int32_t SC_uptimeMillis() { return nanoseconds_to_milliseconds(systemTime(SYSTEM_TIME_MONOTONIC)); } static int32_t SC_startTimeMillis() { GET_TLS(); return sc->mEnviroment.mStartTimeMillis; } static int32_t SC_elapsedTimeMillis() { GET_TLS(); return nanoseconds_to_milliseconds(systemTime(SYSTEM_TIME_MONOTONIC)) - sc->mEnviroment.mStartTimeMillis; } ////////////////////////////////////////////////////////////////////////////// // Matrix routines ////////////////////////////////////////////////////////////////////////////// Loading Loading @@ -895,6 +914,12 @@ ScriptCState::SymbolTable_t ScriptCState::gSyms[] = { "int", "()" }, { "year", (void *)&SC_year, "int", "()" }, { "uptimeMillis", (void*)&SC_uptimeMillis, "int", "()" }, // TODO: use long instead { "startTimeMillis", (void*)&SC_startTimeMillis, "int", "()" }, // TODO: use long instead { "elapsedTimeMillis", (void*)&SC_elapsedTimeMillis, "int", "()" }, // TODO: use long instead // matrix { "matrixLoadIdentity", (void *)&SC_matrixLoadIdentity, Loading