diff options
Diffstat (limited to 'libs/rs')
-rw-r--r-- | libs/rs/driver/rsdCore.cpp | 2 | ||||
-rw-r--r-- | libs/rs/driver/rsdGL.cpp | 5 | ||||
-rw-r--r-- | libs/rs/rs.spec | 3 | ||||
-rw-r--r-- | libs/rs/rsContext.cpp | 22 | ||||
-rw-r--r-- | libs/rs/rsProgramRaster.cpp | 27 | ||||
-rw-r--r-- | libs/rs/rsProgramRaster.h | 9 |
6 files changed, 17 insertions, 51 deletions
diff --git a/libs/rs/driver/rsdCore.cpp b/libs/rs/driver/rsdCore.cpp index a38fff7..f8107d9 100644 --- a/libs/rs/driver/rsdCore.cpp +++ b/libs/rs/driver/rsdCore.cpp @@ -219,7 +219,7 @@ bool rsdHalInit(Context *rsc, uint32_t version_major, uint32_t version_minor) { int cpu = sysconf(_SC_NPROCESSORS_ONLN); - LOGV("RS Launching thread(s), reported CPU count %i", cpu); + LOGV("%p Launching thread(s), CPUs %i", rsc, cpu); if (cpu < 2) cpu = 0; dc->mWorkers.mCount = (uint32_t)cpu; diff --git a/libs/rs/driver/rsdGL.cpp b/libs/rs/driver/rsdGL.cpp index c5b81db..98d9486 100644 --- a/libs/rs/driver/rsdGL.cpp +++ b/libs/rs/driver/rsdGL.cpp @@ -129,11 +129,8 @@ void rsdGLShutdown(const Context *rsc) { dc->gl.shaderCache->cleanupAll(); delete dc->gl.shaderCache; - delete dc->gl.vertexArrayState; - LOGV("%p, deinitEGL", rsc); - if (dc->gl.egl.context != EGL_NO_CONTEXT) { RSD_CALL_GL(eglMakeCurrent, dc->gl.egl.display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); @@ -363,7 +360,7 @@ bool rsdGLInit(const Context *rsc) { dc->gl.vertexArrayState->init(dc->gl.gl.maxVertexAttribs); dc->gl.currentFrameBuffer = NULL; - LOGV("initGLThread end %p", rsc); + LOGV("%p initGLThread end", rsc); rsc->setWatchdogGL(NULL, 0, NULL); return true; } diff --git a/libs/rs/rs.spec b/libs/rs/rs.spec index f277582..20b1f52 100644 --- a/libs/rs/rs.spec +++ b/libs/rs/rs.spec @@ -329,10 +329,7 @@ ProgramStoreCreate { ProgramRasterCreate { direct - param bool pointSmooth - param bool lineSmooth param bool pointSprite - param float lineWidth param RsCullMode cull ret RsProgramRaster } diff --git a/libs/rs/rsContext.cpp b/libs/rs/rsContext.cpp index 948d51c..53d4970 100644 --- a/libs/rs/rsContext.cpp +++ b/libs/rs/rsContext.cpp @@ -37,11 +37,10 @@ pthread_mutex_t Context::gLibMutex = PTHREAD_MUTEX_INITIALIZER; bool Context::initGLThread() { pthread_mutex_lock(&gInitMutex); - LOGV("initGLThread start %p", this); if (!mHal.funcs.initGraphics(this)) { pthread_mutex_unlock(&gInitMutex); - LOGE("%p, initGraphics failed", this); + LOGE("%p initGraphics failed", this); return false; } @@ -50,7 +49,6 @@ bool Context::initGLThread() { } void Context::deinitEGL() { - LOGV("%p, deinitEGL", this); mHal.funcs.shutdownGraphics(this); } @@ -284,7 +282,7 @@ void * Context::threadProc(void *vrsc) { } } - LOGV("%p, RS Thread exiting", rsc); + LOGV("%p RS Thread exiting", rsc); if (rsc->mIsGraphicsContext) { pthread_mutex_lock(&gInitMutex); @@ -292,7 +290,7 @@ void * Context::threadProc(void *vrsc) { pthread_mutex_unlock(&gInitMutex); } - LOGV("%p, RS Thread exited", rsc); + LOGV("%p RS Thread exited", rsc); return NULL; } @@ -426,7 +424,7 @@ bool Context::initContext(Device *dev, const RsSurfaceConfig *sc) { } Context::~Context() { - LOGV("Context::~Context"); + LOGV("%p Context::~Context", this); if (!mIsContextLite) { mIO.coreFlush(); @@ -450,7 +448,7 @@ Context::~Context() { } pthread_mutex_unlock(&gInitMutex); } - LOGV("Context::~Context done"); + LOGV("%p Context::~Context done", this); } void Context::setSurface(uint32_t w, uint32_t h, RsNativeWindow sur) { @@ -667,10 +665,10 @@ void rsi_ContextDestroyWorker(Context *rsc) { } void rsi_ContextDestroy(Context *rsc) { - LOGV("rsContextDestroy %p", rsc); + LOGV("%p rsContextDestroy", rsc); rsContextDestroyWorker(rsc); delete rsc; - LOGV("rsContextDestroy 2 %p", rsc); + LOGV("%p rsContextDestroy done", rsc); } @@ -701,7 +699,7 @@ void rsi_ContextDeinitToClient(Context *rsc) { RsContext rsContextCreate(RsDevice vdev, uint32_t version, uint32_t sdkVersion) { - LOGV("rsContextCreate %p", vdev); + LOGV("rsContextCreate dev=%p", vdev); Device * dev = static_cast<Device *>(vdev); Context *rsc = Context::createContext(dev, NULL); if (rsc) { @@ -713,14 +711,14 @@ RsContext rsContextCreate(RsDevice vdev, uint32_t version, RsContext rsContextCreateGL(RsDevice vdev, uint32_t version, uint32_t sdkVersion, RsSurfaceConfig sc, uint32_t dpi) { - LOGV("rsContextCreateGL %p", vdev); + LOGV("rsContextCreateGL dev=%p", vdev); Device * dev = static_cast<Device *>(vdev); Context *rsc = Context::createContext(dev, &sc); if (rsc) { rsc->setTargetSdkVersion(sdkVersion); rsc->setDPI(dpi); } - LOGV("rsContextCreateGL ret %p ", rsc); + LOGV("%p rsContextCreateGL ret", rsc); return rsc; } diff --git a/libs/rs/rsProgramRaster.cpp b/libs/rs/rsProgramRaster.cpp index 945b5ec..94bfe42 100644 --- a/libs/rs/rsProgramRaster.cpp +++ b/libs/rs/rsProgramRaster.cpp @@ -21,19 +21,12 @@ using namespace android; using namespace android::renderscript; -ProgramRaster::ProgramRaster(Context *rsc, bool pointSmooth, - bool lineSmooth, bool pointSprite, - float lineWidth, RsCullMode cull) +ProgramRaster::ProgramRaster(Context *rsc, bool pointSprite, RsCullMode cull) : ProgramBase(rsc) { memset(&mHal, 0, sizeof(mHal)); - - mHal.state.pointSmooth = pointSmooth; - mHal.state.lineSmooth = lineSmooth; mHal.state.pointSprite = pointSprite; - mHal.state.lineWidth = lineWidth; mHal.state.cull = cull; - rsc->mHal.funcs.raster.init(rsc, this); } @@ -74,8 +67,7 @@ ProgramRasterState::~ProgramRasterState() { } void ProgramRasterState::init(Context *rsc) { - mDefault.set(ProgramRaster::getProgramRaster(rsc, false, false, - false, 1.f, RS_CULL_BACK).get()); + mDefault.set(ProgramRaster::getProgramRaster(rsc, false, RS_CULL_BACK).get()); } void ProgramRasterState::deinit(Context *rsc) { @@ -84,19 +76,13 @@ void ProgramRasterState::deinit(Context *rsc) { } ObjectBaseRef<ProgramRaster> ProgramRaster::getProgramRaster(Context *rsc, - bool pointSmooth, - bool lineSmooth, bool pointSprite, - float lineWidth, RsCullMode cull) { ObjectBaseRef<ProgramRaster> returnRef; ObjectBase::asyncLock(); for (uint32_t ct = 0; ct < rsc->mStateRaster.mRasterPrograms.size(); ct++) { ProgramRaster *existing = rsc->mStateRaster.mRasterPrograms[ct]; - if (existing->mHal.state.pointSmooth != pointSmooth) continue; - if (existing->mHal.state.lineSmooth != lineSmooth) continue; if (existing->mHal.state.pointSprite != pointSprite) continue; - if (existing->mHal.state.lineWidth != lineWidth) continue; if (existing->mHal.state.cull != cull) continue; returnRef.set(existing); ObjectBase::asyncUnlock(); @@ -104,8 +90,7 @@ ObjectBaseRef<ProgramRaster> ProgramRaster::getProgramRaster(Context *rsc, } ObjectBase::asyncUnlock(); - ProgramRaster *pr = new ProgramRaster(rsc, pointSmooth, - lineSmooth, pointSprite, lineWidth, cull); + ProgramRaster *pr = new ProgramRaster(rsc, pointSprite, cull); returnRef.set(pr); ObjectBase::asyncLock(); @@ -118,10 +103,8 @@ ObjectBaseRef<ProgramRaster> ProgramRaster::getProgramRaster(Context *rsc, namespace android { namespace renderscript { -RsProgramRaster rsi_ProgramRasterCreate(Context * rsc, bool pointSmooth, bool lineSmooth, - bool pointSprite, float lineWidth, RsCullMode cull) { - ObjectBaseRef<ProgramRaster> pr = ProgramRaster::getProgramRaster(rsc, pointSmooth, lineSmooth, - pointSprite, lineWidth, cull); +RsProgramRaster rsi_ProgramRasterCreate(Context * rsc, bool pointSprite, RsCullMode cull) { + ObjectBaseRef<ProgramRaster> pr = ProgramRaster::getProgramRaster(rsc, pointSprite, cull); pr->incUserRef(); return pr.get(); } diff --git a/libs/rs/rsProgramRaster.h b/libs/rs/rsProgramRaster.h index 09d7d54..20af30a 100644 --- a/libs/rs/rsProgramRaster.h +++ b/libs/rs/rsProgramRaster.h @@ -33,19 +33,13 @@ public: static ProgramRaster *createFromStream(Context *rsc, IStream *stream); static ObjectBaseRef<ProgramRaster> getProgramRaster(Context *rsc, - bool pointSmooth, - bool lineSmooth, bool pointSprite, - float lineWidth, RsCullMode cull); struct Hal { mutable void *drv; struct State { - bool pointSmooth; - bool lineSmooth; bool pointSprite; - float lineWidth; RsCullMode cull; }; State state; @@ -58,10 +52,7 @@ protected: private: ProgramRaster(Context *rsc, - bool pointSmooth, - bool lineSmooth, bool pointSprite, - float lineWidth, RsCullMode cull); }; |