From b43a1e5ddf274eb5e01dc8e450bd15b640bebe9f Mon Sep 17 00:00:00 2001 From: Alex Sakhartchouk Date: Wed, 28 Mar 2012 14:18:15 -0700 Subject: Moving libRS Change-Id: I1e42204e862585b9c2f7818b615890c60f08faf6 --- libs/rs/rsScript.cpp | 171 --------------------------------------------------- 1 file changed, 171 deletions(-) delete mode 100644 libs/rs/rsScript.cpp (limited to 'libs/rs/rsScript.cpp') diff --git a/libs/rs/rsScript.cpp b/libs/rs/rsScript.cpp deleted file mode 100644 index 6a3bd4bf7a08..000000000000 --- a/libs/rs/rsScript.cpp +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Copyright (C) 2009-2012 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "rsContext.h" -#include - -using namespace android; -using namespace android::renderscript; - -Script::Script(Context *rsc) : ObjectBase(rsc) { - memset(&mEnviroment, 0, sizeof(mEnviroment)); - memset(&mHal, 0, sizeof(mHal)); - - mSlots = NULL; - mTypes = NULL; - mInitialized = false; -} - -Script::~Script() { - if (mSlots) { - delete [] mSlots; - mSlots = NULL; - } - if (mTypes) { - delete [] mTypes; - mTypes = NULL; - } -} - -void Script::setSlot(uint32_t slot, Allocation *a) { - //ALOGE("setSlot %i %p", slot, a); - if (slot >= mHal.info.exportedVariableCount) { - ALOGE("Script::setSlot unable to set allocation, invalid slot index"); - return; - } - - mSlots[slot].set(a); - if (a != NULL) { - mRSC->mHal.funcs.script.setGlobalBind(mRSC, this, slot, a->getPtr()); - } else { - mRSC->mHal.funcs.script.setGlobalBind(mRSC, this, slot, NULL); - } -} - -void Script::setVar(uint32_t slot, const void *val, size_t len) { - //ALOGE("setVar %i %p %i", slot, val, len); - if (slot >= mHal.info.exportedVariableCount) { - ALOGE("Script::setVar unable to set allocation, invalid slot index"); - return; - } - mRSC->mHal.funcs.script.setGlobalVar(mRSC, this, slot, (void *)val, len); -} - -void Script::setVarObj(uint32_t slot, ObjectBase *val) { - //ALOGE("setVarObj %i %p", slot, val); - if (slot >= mHal.info.exportedVariableCount) { - ALOGE("Script::setVarObj unable to set allocation, invalid slot index"); - return; - } - //ALOGE("setvarobj %i %p", slot, val); - mRSC->mHal.funcs.script.setGlobalObj(mRSC, this, slot, val); -} - -bool Script::freeChildren() { - incSysRef(); - mRSC->mHal.funcs.script.invokeFreeChildren(mRSC, this); - return decSysRef(); -} - -namespace android { -namespace renderscript { - -void rsi_ScriptBindAllocation(Context * rsc, RsScript vs, RsAllocation va, uint32_t slot) { - Script *s = static_cast