Loading graphics/java/android/renderscript/RenderScript.java +7 −0 Original line number Diff line number Diff line Loading @@ -206,6 +206,13 @@ public class RenderScript { } } public void destroy() { nContextDestroy(mContext); mContext = 0; nDeviceDestroy(mDev); mDev = 0; } ////////////////////////////////////////////////////////////////////////////////// // Triangle Mesh Loading libs/rs/rsContext.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -243,11 +243,13 @@ void * Context::threadProc(void *vrsc) } } LOGV("RS Thread exiting"); glClearColor(0,0,0,0); glClear(GL_COLOR_BUFFER_BIT); eglSwapBuffers(rsc->mEGL.mDisplay, rsc->mEGL.mSurface); eglTerminate(rsc->mEGL.mDisplay); rsc->objDestroyOOBRun(); LOGV("RS Thread exited"); return NULL; } Loading Loading @@ -298,9 +300,11 @@ Context::Context(Device *dev, Surface *sur, bool useDepth) Context::~Context() { LOGV("Context::~Context"); mExit = true; void *res; mIO.shutdown(); int status = pthread_join(mThreadId, &res); objDestroyOOBRun(); Loading libs/rs/rsLocklessFifo.cpp +15 −4 Original line number Diff line number Diff line Loading @@ -25,6 +25,16 @@ LocklessCommandFifo::LocklessCommandFifo() LocklessCommandFifo::~LocklessCommandFifo() { if (!mInShutdown) { shutdown(); } free(mBuffer); } void LocklessCommandFifo::shutdown() { mInShutdown = true; mSignalToWorker.set(); } bool LocklessCommandFifo::init(uint32_t sizeInBytes) Loading @@ -42,6 +52,7 @@ bool LocklessCommandFifo::init(uint32_t sizeInBytes) return false; } mInShutdown = false; mSize = sizeInBytes; mPut = mBuffer; mGet = mBuffer; Loading Loading @@ -115,7 +126,7 @@ const void * LocklessCommandFifo::get(uint32_t *command, uint32_t *bytesData) { while(1) { //dumpState("get"); while(isEmpty()) { while(isEmpty() && !mInShutdown) { mSignalToControl.set(); mSignalToWorker.wait(); } Loading libs/rs/rsLocklessFifo.h +4 −2 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ class LocklessCommandFifo { public: bool init(uint32_t size); void shutdown(); LocklessCommandFifo(); ~LocklessCommandFifo(); Loading Loading @@ -59,6 +60,7 @@ protected: uint8_t * mBuffer; uint8_t * mEnd; uint8_t mSize; bool mInShutdown; Signal mSignalToWorker; Signal mSignalToControl; Loading libs/rs/rsThreadIO.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,11 @@ ThreadIO::~ThreadIO() { } void ThreadIO::shutdown() { mToCore.shutdown(); } bool ThreadIO::playCoreCommands(Context *con, bool waitForCommand) { bool ret = false; Loading Loading
graphics/java/android/renderscript/RenderScript.java +7 −0 Original line number Diff line number Diff line Loading @@ -206,6 +206,13 @@ public class RenderScript { } } public void destroy() { nContextDestroy(mContext); mContext = 0; nDeviceDestroy(mDev); mDev = 0; } ////////////////////////////////////////////////////////////////////////////////// // Triangle Mesh Loading
libs/rs/rsContext.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -243,11 +243,13 @@ void * Context::threadProc(void *vrsc) } } LOGV("RS Thread exiting"); glClearColor(0,0,0,0); glClear(GL_COLOR_BUFFER_BIT); eglSwapBuffers(rsc->mEGL.mDisplay, rsc->mEGL.mSurface); eglTerminate(rsc->mEGL.mDisplay); rsc->objDestroyOOBRun(); LOGV("RS Thread exited"); return NULL; } Loading Loading @@ -298,9 +300,11 @@ Context::Context(Device *dev, Surface *sur, bool useDepth) Context::~Context() { LOGV("Context::~Context"); mExit = true; void *res; mIO.shutdown(); int status = pthread_join(mThreadId, &res); objDestroyOOBRun(); Loading
libs/rs/rsLocklessFifo.cpp +15 −4 Original line number Diff line number Diff line Loading @@ -25,6 +25,16 @@ LocklessCommandFifo::LocklessCommandFifo() LocklessCommandFifo::~LocklessCommandFifo() { if (!mInShutdown) { shutdown(); } free(mBuffer); } void LocklessCommandFifo::shutdown() { mInShutdown = true; mSignalToWorker.set(); } bool LocklessCommandFifo::init(uint32_t sizeInBytes) Loading @@ -42,6 +52,7 @@ bool LocklessCommandFifo::init(uint32_t sizeInBytes) return false; } mInShutdown = false; mSize = sizeInBytes; mPut = mBuffer; mGet = mBuffer; Loading Loading @@ -115,7 +126,7 @@ const void * LocklessCommandFifo::get(uint32_t *command, uint32_t *bytesData) { while(1) { //dumpState("get"); while(isEmpty()) { while(isEmpty() && !mInShutdown) { mSignalToControl.set(); mSignalToWorker.wait(); } Loading
libs/rs/rsLocklessFifo.h +4 −2 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ class LocklessCommandFifo { public: bool init(uint32_t size); void shutdown(); LocklessCommandFifo(); ~LocklessCommandFifo(); Loading Loading @@ -59,6 +60,7 @@ protected: uint8_t * mBuffer; uint8_t * mEnd; uint8_t mSize; bool mInShutdown; Signal mSignalToWorker; Signal mSignalToControl; Loading
libs/rs/rsThreadIO.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,11 @@ ThreadIO::~ThreadIO() { } void ThreadIO::shutdown() { mToCore.shutdown(); } bool ThreadIO::playCoreCommands(Context *con, bool waitForCommand) { bool ret = false; Loading