diff options
Diffstat (limited to 'libs/rs')
-rw-r--r-- | libs/rs/Android.mk | 7 | ||||
-rw-r--r-- | libs/rs/driver/rsdBcc.cpp | 1 | ||||
-rw-r--r-- | libs/rs/driver/rsdBcc.h | 1 | ||||
-rw-r--r-- | libs/rs/rsContext.cpp | 8 | ||||
-rw-r--r-- | libs/rs/rsElement.cpp | 12 | ||||
-rw-r--r-- | libs/rs/rsLocklessFifo.cpp | 6 | ||||
-rw-r--r-- | libs/rs/rsScriptC.cpp | 2 | ||||
-rw-r--r-- | libs/rs/rsThreadIO.cpp | 4 | ||||
-rw-r--r-- | libs/rs/rs_hal.h | 1 |
9 files changed, 19 insertions, 23 deletions
diff --git a/libs/rs/Android.mk b/libs/rs/Android.mk index d9cc6b6..a8aa0c7 100644 --- a/libs/rs/Android.mk +++ b/libs/rs/Android.mk @@ -77,11 +77,6 @@ rs_generated_source += $(GEN) LOCAL_GENERATED_SOURCES += $(GEN) -# libRS needs libacc, which isn't 64-bit clean, and so can't be built -# for the simulator on gHardy, and therefore libRS needs to be excluded -# from the simulator as well. -ifneq ($(TARGET_SIMULATOR),true) - LOCAL_SRC_FILES:= \ rsAdapter.cpp \ rsAllocation.cpp \ @@ -228,5 +223,3 @@ LOCAL_STATIC_LIBRARIES := libcutils libutils LOCAL_LDLIBS := -lpthread include $(BUILD_HOST_STATIC_LIBRARY) - -endif #simulator diff --git a/libs/rs/driver/rsdBcc.cpp b/libs/rs/driver/rsdBcc.cpp index 62eb24e..bbf2836 100644 --- a/libs/rs/driver/rsdBcc.cpp +++ b/libs/rs/driver/rsdBcc.cpp @@ -269,6 +269,7 @@ static void wc_x(void *usr, uint32_t idx) { void rsdScriptInvokeForEach(const Context *rsc, Script *s, + uint32_t slot, const Allocation * ain, Allocation * aout, const void * usr, diff --git a/libs/rs/driver/rsdBcc.h b/libs/rs/driver/rsdBcc.h index 62b50f4..67929bc 100644 --- a/libs/rs/driver/rsdBcc.h +++ b/libs/rs/driver/rsdBcc.h @@ -32,6 +32,7 @@ void rsdScriptInvokeFunction(const android::renderscript::Context *dc, void rsdScriptInvokeForEach(const android::renderscript::Context *rsc, android::renderscript::Script *s, + uint32_t slot, const android::renderscript::Allocation * ain, android::renderscript::Allocation * aout, const void * usr, diff --git a/libs/rs/rsContext.cpp b/libs/rs/rsContext.cpp index 44e9d89..447a7ff 100644 --- a/libs/rs/rsContext.cpp +++ b/libs/rs/rsContext.cpp @@ -340,10 +340,6 @@ Context::Context() { Context * Context::createContext(Device *dev, const RsSurfaceConfig *sc) { Context * rsc = new Context(); - // Temporary to avoid breaking the tools - if (!dev) { - return rsc; - } if (!rsc->initContext(dev, sc)) { delete rsc; return NULL; @@ -693,7 +689,9 @@ RsContext rsContextCreateGL(RsDevice vdev, uint32_t version, LOGV("rsContextCreateGL %p", vdev); Device * dev = static_cast<Device *>(vdev); Context *rsc = Context::createContext(dev, &sc); - rsc->setDPI(dpi); + if (rsc) { + rsc->setDPI(dpi); + } LOGV("rsContextCreateGL ret %p ", rsc); return rsc; } diff --git a/libs/rs/rsElement.cpp b/libs/rs/rsElement.cpp index 2b58e9e..b77b18a 100644 --- a/libs/rs/rsElement.cpp +++ b/libs/rs/rsElement.cpp @@ -263,10 +263,10 @@ void Element::incRefs(const void *ptr) const { const uint8_t *p = static_cast<const uint8_t *>(ptr); for (uint32_t i=0; i < mFieldCount; i++) { if (mFields[i].e->mHasReference) { - p = &p[mFields[i].offsetBits >> 3]; + const uint8_t *p2 = &p[mFields[i].offsetBits >> 3]; for (uint32_t ct=0; ct < mFields[i].arraySize; ct++) { - mFields[i].e->incRefs(p); - p += mFields[i].e->getSizeBytes(); + mFields[i].e->incRefs(p2); + p2 += mFields[i].e->getSizeBytes(); } } } @@ -285,10 +285,10 @@ void Element::decRefs(const void *ptr) const { const uint8_t *p = static_cast<const uint8_t *>(ptr); for (uint32_t i=0; i < mFieldCount; i++) { if (mFields[i].e->mHasReference) { - p = &p[mFields[i].offsetBits >> 3]; + const uint8_t *p2 = &p[mFields[i].offsetBits >> 3]; for (uint32_t ct=0; ct < mFields[i].arraySize; ct++) { - mFields[i].e->decRefs(p); - p += mFields[i].e->getSizeBytes(); + mFields[i].e->decRefs(p2); + p2 += mFields[i].e->getSizeBytes(); } } } diff --git a/libs/rs/rsLocklessFifo.cpp b/libs/rs/rsLocklessFifo.cpp index 70b7278..7023a1f 100644 --- a/libs/rs/rsLocklessFifo.cpp +++ b/libs/rs/rsLocklessFifo.cpp @@ -21,14 +21,16 @@ using namespace android; using namespace android::renderscript; -LocklessCommandFifo::LocklessCommandFifo() { +LocklessCommandFifo::LocklessCommandFifo() : mBuffer(0) { } LocklessCommandFifo::~LocklessCommandFifo() { if (!mInShutdown) { shutdown(); } - free(mBuffer); + if (mBuffer) { + free(mBuffer); + } } void LocklessCommandFifo::shutdown() { diff --git a/libs/rs/rsScriptC.cpp b/libs/rs/rsScriptC.cpp index b230bb5..e8b1014 100644 --- a/libs/rs/rsScriptC.cpp +++ b/libs/rs/rsScriptC.cpp @@ -121,7 +121,7 @@ void ScriptC::runForEach(Context *rsc, setupGLState(rsc); setupScript(rsc); - rsc->mHal.funcs.script.invokeForEach(rsc, this, ain, aout, usr, usrBytes, sc); + rsc->mHal.funcs.script.invokeForEach(rsc, this, 0, ain, aout, usr, usrBytes, sc); } void ScriptC::Invoke(Context *rsc, uint32_t slot, const void *data, size_t len) { diff --git a/libs/rs/rsThreadIO.cpp b/libs/rs/rsThreadIO.cpp index ab164c3..1c8b89c 100644 --- a/libs/rs/rsThreadIO.cpp +++ b/libs/rs/rsThreadIO.cpp @@ -21,8 +21,7 @@ using namespace android; using namespace android::renderscript; -ThreadIO::ThreadIO() { - mToCore.init(16 * 1024); +ThreadIO::ThreadIO() : mUsingSocket(false) { } ThreadIO::~ThreadIO() { @@ -30,6 +29,7 @@ ThreadIO::~ThreadIO() { void ThreadIO::init(bool useSocket) { mUsingSocket = useSocket; + mToCore.init(16 * 1024); if (mUsingSocket) { mToClientSocket.init(); diff --git a/libs/rs/rs_hal.h b/libs/rs/rs_hal.h index 928dca5..6a4537b 100644 --- a/libs/rs/rs_hal.h +++ b/libs/rs/rs_hal.h @@ -70,6 +70,7 @@ typedef struct { int (*invokeRoot)(const Context *rsc, Script *s); void (*invokeForEach)(const Context *rsc, Script *s, + uint32_t slot, const Allocation * ain, Allocation * aout, const void * usr, |