diff options
| author | Tim Murray <timmurray@google.com> | 2013-08-20 17:19:47 -0700 |
|---|---|---|
| committer | Tim Murray <timmurray@google.com> | 2013-08-21 15:13:44 -0700 |
| commit | 10913a5c37ba119bef335320d3e8be25212c05ad (patch) | |
| tree | 469d96dc19e4d9b4efecb76147cced747256787f /cpp/Script.cpp | |
| parent | 21fa7a0a23eddab88ff261017f6d7a2548b4d89a (diff) | |
Make error handling kill context activity. Add parameter validation.
bug 10427951
Change-Id: I4abba969e34903265b84ee88d6a90bc9b9df5481
Diffstat (limited to 'cpp/Script.cpp')
| -rw-r--r-- | cpp/Script.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/cpp/Script.cpp b/cpp/Script.cpp index 29fe12d0..8e1af549 100644 --- a/cpp/Script.cpp +++ b/cpp/Script.cpp @@ -17,12 +17,13 @@ #include <malloc.h> #include "RenderScript.h" +#include "rsCppInternal.h" using namespace android; using namespace RSC; void Script::invoke(uint32_t slot, const void *v, size_t len) const { - RS::dispatch->ScriptInvokeV(mRS->getContext(), getID(), slot, v, len); + tryDispatch(mRS, RS::dispatch->ScriptInvokeV(mRS->getContext(), getID(), slot, v, len)); } void Script::forEach(uint32_t slot, sp<const Allocation> ain, sp<const Allocation> aout, @@ -32,7 +33,7 @@ void Script::forEach(uint32_t slot, sp<const Allocation> ain, sp<const Allocatio } void *in_id = BaseObj::getObjID(ain); void *out_id = BaseObj::getObjID(aout); - RS::dispatch->ScriptForEach(mRS->getContext(), getID(), slot, in_id, out_id, usr, usrLen, NULL, 0); + tryDispatch(mRS, RS::dispatch->ScriptForEach(mRS->getContext(), getID(), slot, in_id, out_id, usr, usrLen, NULL, 0)); } @@ -41,16 +42,16 @@ Script::Script(void *id, sp<RS> rs) : BaseObj(id, rs) { void Script::bindAllocation(sp<Allocation> va, uint32_t slot) const { - RS::dispatch->ScriptBindAllocation(mRS->getContext(), getID(), BaseObj::getObjID(va), slot); + tryDispatch(mRS, RS::dispatch->ScriptBindAllocation(mRS->getContext(), getID(), BaseObj::getObjID(va), slot)); } void Script::setVar(uint32_t index, sp<const BaseObj> o) const { - RS::dispatch->ScriptSetVarObj(mRS->getContext(), getID(), index, (o == NULL) ? 0 : o->getID()); + tryDispatch(mRS, RS::dispatch->ScriptSetVarObj(mRS->getContext(), getID(), index, (o == NULL) ? 0 : o->getID())); } void Script::setVar(uint32_t index, const void *v, size_t len) const { - RS::dispatch->ScriptSetVarV(mRS->getContext(), getID(), index, v, len); + tryDispatch(mRS, RS::dispatch->ScriptSetVarV(mRS->getContext(), getID(), index, v, len)); } void Script::FieldBase::init(sp<RS> rs, uint32_t dimx, uint32_t usages) { |
