Loading libs/rs/java/ImageProcessing/src/com/android/rs/image/threshold.rs +0 −2 Original line number Diff line number Diff line Loading @@ -65,7 +65,6 @@ static void computeGaussianWeights() { static void copyInput() { RS_DEBUG_MARKER; rs_allocation ain = rsGetAllocation(InPixel); uint32_t dimx = rsAllocationGetDimX(ain); uint32_t dimy = rsAllocationGetDimY(ain); Loading @@ -74,7 +73,6 @@ static void copyInput() { ScratchPixel1[x + y * dimx] = convert_float4(InPixel[x + y * dimx]); } } RS_DEBUG_MARKER; } void filter() { Loading libs/rs/rsContext.cpp +11 −5 Original line number Diff line number Diff line Loading @@ -282,14 +282,14 @@ void * Context::threadProc(void *vrsc) rsc->props.mLogShadersUniforms = getProp("debug.rs.shader.uniforms"); rsc->props.mLogVisual = getProp("debug.rs.visual"); ScriptTLSStruct *tlsStruct = new ScriptTLSStruct; if (!tlsStruct) { rsc->mTlsStruct = new ScriptTLSStruct; if (!rsc->mTlsStruct) { LOGE("Error allocating tls storage"); return NULL; } tlsStruct->mContext = rsc; tlsStruct->mScript = NULL; int status = pthread_setspecific(rsc->gThreadTLSKey, tlsStruct); rsc->mTlsStruct->mContext = rsc; rsc->mTlsStruct->mScript = NULL; int status = pthread_setspecific(rsc->gThreadTLSKey, rsc->mTlsStruct); if (status) { LOGE("pthread_setspecific %i", status); } Loading Loading @@ -361,6 +361,7 @@ void * Context::threadProc(void *vrsc) rsc->deinitEGL(); pthread_mutex_unlock(&gInitMutex); } delete rsc->mTlsStruct; LOGV("%p, RS Thread exited", rsc); return NULL; Loading @@ -387,6 +388,11 @@ void * Context::helperThreadProc(void *vrsc) #endif setpriority(PRIO_PROCESS, rsc->mWorkers.mNativeThreadId[idx], rsc->mThreadPriority); int status = pthread_setspecific(rsc->gThreadTLSKey, rsc->mTlsStruct); if (status) { LOGE("pthread_setspecific %i", status); } while(rsc->mRunning) { rsc->mWorkers.mLaunchSignals[idx].wait(); if (rsc->mWorkers.mLaunchCallback) { Loading libs/rs/rsContext.h +19 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,24 @@ namespace android { namespace renderscript { #if 0 #define CHECK_OBJ(o) { \ GET_TLS(); \ if(!ObjectBase::isValid(rsc, (const ObjectBase *)o)) { \ LOGE("Bad object %p at %s, %i", o, __FILE__, __LINE__); \ } \ } #define CHECK_OBJ_OR_NULL(o) { \ GET_TLS(); \ if(o && !ObjectBase::isValid(rsc, (const ObjectBase *)o)) { \ LOGE("Bad object %p at %s, %i", o, __FILE__, __LINE__); \ } \ } #else #define CHECK_OBJ(o) #define CHECK_OBJ_OR_NULL(o) #endif class Context { public: Loading @@ -64,6 +82,7 @@ public: Context * mContext; Script * mScript; }; ScriptTLSStruct *mTlsStruct; typedef void (*WorkerCallback_t)(void *usr, uint32_t idx); Loading libs/rs/rsObjectBase.cpp +12 −0 Original line number Diff line number Diff line Loading @@ -195,3 +195,15 @@ void ObjectBase::dumpAll(Context *rsc) } } bool ObjectBase::isValid(const Context *rsc, const ObjectBase *obj) { const ObjectBase * o = rsc->mObjHead; while (o) { if (o == obj) { return true; } o = o->mNext; } return false; } libs/rs/rsObjectBase.h +2 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,8 @@ public: virtual void serialize(OStream *stream) const = 0; virtual RsA3DClassID getClassId() const = 0; static bool isValid(const Context *rsc, const ObjectBase *obj); protected: const char *mAllocFile; uint32_t mAllocLine; Loading Loading
libs/rs/java/ImageProcessing/src/com/android/rs/image/threshold.rs +0 −2 Original line number Diff line number Diff line Loading @@ -65,7 +65,6 @@ static void computeGaussianWeights() { static void copyInput() { RS_DEBUG_MARKER; rs_allocation ain = rsGetAllocation(InPixel); uint32_t dimx = rsAllocationGetDimX(ain); uint32_t dimy = rsAllocationGetDimY(ain); Loading @@ -74,7 +73,6 @@ static void copyInput() { ScratchPixel1[x + y * dimx] = convert_float4(InPixel[x + y * dimx]); } } RS_DEBUG_MARKER; } void filter() { Loading
libs/rs/rsContext.cpp +11 −5 Original line number Diff line number Diff line Loading @@ -282,14 +282,14 @@ void * Context::threadProc(void *vrsc) rsc->props.mLogShadersUniforms = getProp("debug.rs.shader.uniforms"); rsc->props.mLogVisual = getProp("debug.rs.visual"); ScriptTLSStruct *tlsStruct = new ScriptTLSStruct; if (!tlsStruct) { rsc->mTlsStruct = new ScriptTLSStruct; if (!rsc->mTlsStruct) { LOGE("Error allocating tls storage"); return NULL; } tlsStruct->mContext = rsc; tlsStruct->mScript = NULL; int status = pthread_setspecific(rsc->gThreadTLSKey, tlsStruct); rsc->mTlsStruct->mContext = rsc; rsc->mTlsStruct->mScript = NULL; int status = pthread_setspecific(rsc->gThreadTLSKey, rsc->mTlsStruct); if (status) { LOGE("pthread_setspecific %i", status); } Loading Loading @@ -361,6 +361,7 @@ void * Context::threadProc(void *vrsc) rsc->deinitEGL(); pthread_mutex_unlock(&gInitMutex); } delete rsc->mTlsStruct; LOGV("%p, RS Thread exited", rsc); return NULL; Loading @@ -387,6 +388,11 @@ void * Context::helperThreadProc(void *vrsc) #endif setpriority(PRIO_PROCESS, rsc->mWorkers.mNativeThreadId[idx], rsc->mThreadPriority); int status = pthread_setspecific(rsc->gThreadTLSKey, rsc->mTlsStruct); if (status) { LOGE("pthread_setspecific %i", status); } while(rsc->mRunning) { rsc->mWorkers.mLaunchSignals[idx].wait(); if (rsc->mWorkers.mLaunchCallback) { Loading
libs/rs/rsContext.h +19 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,24 @@ namespace android { namespace renderscript { #if 0 #define CHECK_OBJ(o) { \ GET_TLS(); \ if(!ObjectBase::isValid(rsc, (const ObjectBase *)o)) { \ LOGE("Bad object %p at %s, %i", o, __FILE__, __LINE__); \ } \ } #define CHECK_OBJ_OR_NULL(o) { \ GET_TLS(); \ if(o && !ObjectBase::isValid(rsc, (const ObjectBase *)o)) { \ LOGE("Bad object %p at %s, %i", o, __FILE__, __LINE__); \ } \ } #else #define CHECK_OBJ(o) #define CHECK_OBJ_OR_NULL(o) #endif class Context { public: Loading @@ -64,6 +82,7 @@ public: Context * mContext; Script * mScript; }; ScriptTLSStruct *mTlsStruct; typedef void (*WorkerCallback_t)(void *usr, uint32_t idx); Loading
libs/rs/rsObjectBase.cpp +12 −0 Original line number Diff line number Diff line Loading @@ -195,3 +195,15 @@ void ObjectBase::dumpAll(Context *rsc) } } bool ObjectBase::isValid(const Context *rsc, const ObjectBase *obj) { const ObjectBase * o = rsc->mObjHead; while (o) { if (o == obj) { return true; } o = o->mNext; } return false; }
libs/rs/rsObjectBase.h +2 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,8 @@ public: virtual void serialize(OStream *stream) const = 0; virtual RsA3DClassID getClassId() const = 0; static bool isValid(const Context *rsc, const ObjectBase *obj); protected: const char *mAllocFile; uint32_t mAllocLine; Loading