diff options
author | Jason Sams <rjsams@android.com> | 2010-07-19 15:38:19 -0700 |
---|---|---|
committer | Jason Sams <rjsams@android.com> | 2010-07-19 15:38:19 -0700 |
commit | 8e6c17fcc40bfb2391dcadecb397431239ab8a18 (patch) | |
tree | 78253130ab783fb7bf0885a8ef121edd0bba2f04 /libs/rs/rsScriptC_Lib.cpp | |
parent | 6ef3593c3666dda3718e7e06547498ec33451690 (diff) |
Threading RS ForEach.
Change-Id: I5d6fe4db2b6ac0613394bc5a066ff90ec146d60e
Diffstat (limited to 'libs/rs/rsScriptC_Lib.cpp')
-rw-r--r-- | libs/rs/rsScriptC_Lib.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/libs/rs/rsScriptC_Lib.cpp b/libs/rs/rsScriptC_Lib.cpp index 8d9ca9f0b580..9c29ca6f640e 100644 --- a/libs/rs/rsScriptC_Lib.cpp +++ b/libs/rs/rsScriptC_Lib.cpp @@ -329,6 +329,29 @@ static uint32_t SC_allocGetDimFaces(RsAllocation va) return a->getType()->getDimFaces(); } +const void * SC_getElementAtX(RsAllocation va, uint32_t x) +{ + const Allocation *a = static_cast<const Allocation *>(va); + const Type *t = a->getType(); + const uint8_t *p = (const uint8_t *)a->getPtr(); + return &p[t->getElementSizeBytes() * x]; +} + +const void * SC_getElementAtXY(RsAllocation va, uint32_t x, uint32_t y) +{ + const Allocation *a = static_cast<const Allocation *>(va); + const Type *t = a->getType(); + const uint8_t *p = (const uint8_t *)a->getPtr(); + return &p[t->getElementSizeBytes() * (x + y*t->getDimX())]; +} + +const void * SC_getElementAtXYZ(RsAllocation va, uint32_t x, uint32_t y, uint32_t z) +{ + const Allocation *a = static_cast<const Allocation *>(va); + const Type *t = a->getType(); + const uint8_t *p = (const uint8_t *)a->getPtr(); + return &p[t->getElementSizeBytes() * (x + y*t->getDimX())]; +} static void SC_debugF(const char *s, float f) { @@ -350,6 +373,10 @@ static void SC_debugI32(const char *s, int32_t i) { LOGE("%s %i 0x%x", s, i, i); } +static void SC_debugP(const char *s, const void *p) { + LOGE("%s %p", s, p); +} + static uint32_t SC_toClient(void *data, int cmdID, int len, int waitForSpace) { GET_TLS(); @@ -433,12 +460,18 @@ static ScriptCState::SymbolTable_t gSyms[] = { { "rsAllocationGetDimFaces", (void *)&SC_allocGetDimFaces }, { "rsGetAllocation", (void *)&SC_getAllocation }, + { "_Z14rsGetElementAt13rs_allocationj", (void *)&SC_getElementAtX }, + { "_Z14rsGetElementAt13rs_allocationjj", (void *)&SC_getElementAtXY }, + { "_Z14rsGetElementAt13rs_allocationjjj", (void *)&SC_getElementAtXYZ }, + + // Debug { "_Z7rsDebugPKcf", (void *)&SC_debugF }, { "_Z7rsDebugPKcDv2_f", (void *)&SC_debugFv2 }, { "_Z7rsDebugPKcDv3_f", (void *)&SC_debugFv3 }, { "_Z7rsDebugPKcDv4_f", (void *)&SC_debugFv4 }, { "_Z7rsDebugPKci", (void *)&SC_debugI32 }, + { "_Z7rsDebugPKcPKv", (void *)&SC_debugP }, //extern void __attribute__((overloadable))rsDebug(const char *, const void *); |