rsdCore.h revision 709a0978ae141198018ca9769f8d96292a8928e6
1/* 2 * Copyright (C) 2011-2012 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17#ifndef RSD_CORE_H 18#define RSD_CORE_H 19 20#include <rs_hal.h> 21 22#include "../cpu_ref/rsd_cpu.h" 23 24#include "rsMutex.h" 25#include "rsSignal.h" 26 27#include "rsdGL.h" 28 29typedef void (* InvokeFunc_t)(void); 30typedef void (* ForEachFunc_t)(void); 31typedef void (*WorkerCallback_t)(void *usr, uint32_t idx); 32 33typedef struct ScriptTLSStructRec { 34 android::renderscript::Context * mContext; 35 android::renderscript::Script * mScript; 36} ScriptTLSStruct; 37 38typedef struct RsdHalRec { 39 uint32_t version_major; 40 uint32_t version_minor; 41 bool mHasGraphics; 42 43 ScriptTLSStruct mTlsStruct; 44 android::renderscript::RsdCpuReference *mCpuRef; 45 46 RsdGL gl; 47} RsdHal; 48 49void rsdLaunchThreads(android::renderscript::Context *rsc, WorkerCallback_t cbk, void *data); 50 51#endif 52 53