Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2007 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 RENDER_SCRIPT_H |
| 18 | #define RENDER_SCRIPT_H |
| 19 | |
| 20 | #include <stdint.h> |
| 21 | #include <sys/types.h> |
| 22 | |
Jason Sams | 3715b00 | 2012-02-16 16:07:49 -0800 | [diff] [blame] | 23 | #include "rsDefines.h" |
Jason Sams | 6b8552a | 2010-10-13 15:31:10 -0700 | [diff] [blame] | 24 | |
Jason Sams | bad8074 | 2011-03-16 16:29:28 -0700 | [diff] [blame] | 25 | // |
Alex Sakhartchouk | dc763f3 | 2010-10-27 14:10:07 -0700 | [diff] [blame] | 26 | // A3D loading and object update code. |
| 27 | // Should only be called at object creation, not thread safe |
| 28 | RsObjectBase rsaFileA3DGetEntryByIndex(RsContext, uint32_t idx, RsFile); |
Alex Sakhartchouk | 5224a27 | 2011-01-07 11:12:08 -0800 | [diff] [blame] | 29 | RsFile rsaFileA3DCreateFromMemory(RsContext, const void *data, uint32_t len); |
| 30 | RsFile rsaFileA3DCreateFromAsset(RsContext, void *asset); |
| 31 | RsFile rsaFileA3DCreateFromFile(RsContext, const char *path); |
Alex Sakhartchouk | dc763f3 | 2010-10-27 14:10:07 -0700 | [diff] [blame] | 32 | void rsaFileA3DGetNumIndexEntries(RsContext, int32_t *numEntries, RsFile); |
Alex Sakhartchouk | 31aca7d | 2011-10-18 11:08:31 -0700 | [diff] [blame] | 33 | void rsaFileA3DGetIndexEntries(RsContext, RsFileIndexEntry *fileEntries, |
| 34 | uint32_t numEntries, RsFile); |
Alex Sakhartchouk | dc763f3 | 2010-10-27 14:10:07 -0700 | [diff] [blame] | 35 | void rsaGetName(RsContext, void * obj, const char **name); |
| 36 | // Mesh update functions |
| 37 | void rsaMeshGetVertexBufferCount(RsContext, RsMesh, int32_t *vtxCount); |
| 38 | void rsaMeshGetIndexCount(RsContext, RsMesh, int32_t *idxCount); |
| 39 | void rsaMeshGetVertices(RsContext, RsMesh, RsAllocation *vtxData, uint32_t vtxDataCount); |
Alex Sakhartchouk | 31aca7d | 2011-10-18 11:08:31 -0700 | [diff] [blame] | 40 | void rsaMeshGetIndices(RsContext, RsMesh, RsAllocation *va, |
| 41 | uint32_t *primType, uint32_t idxDataCount); |
Alex Sakhartchouk | dc763f3 | 2010-10-27 14:10:07 -0700 | [diff] [blame] | 42 | // Allocation update |
| 43 | const void* rsaAllocationGetType(RsContext con, RsAllocation va); |
| 44 | // Type update |
| 45 | void rsaTypeGetNativeData(RsContext, RsType, uint32_t *typeData, uint32_t typeDataSize); |
| 46 | // Element update |
| 47 | void rsaElementGetNativeData(RsContext, RsElement, uint32_t *elemData, uint32_t elemDataSize); |
Alex Sakhartchouk | 31aca7d | 2011-10-18 11:08:31 -0700 | [diff] [blame] | 48 | void rsaElementGetSubElements(RsContext, RsElement, uint32_t *ids, const char **names, |
| 49 | uint32_t *arraySizes, uint32_t dataSize); |
Jason Sams | 6b8552a | 2010-10-13 15:31:10 -0700 | [diff] [blame] | 50 | |
Jason Sams | 789ca83 | 2011-05-18 17:36:02 -0700 | [diff] [blame] | 51 | RsDevice rsDeviceCreate(); |
| 52 | void rsDeviceDestroy(RsDevice dev); |
| 53 | void rsDeviceSetConfig(RsDevice dev, RsDeviceParam p, int32_t value); |
Jason Sams | 14982c8 | 2013-02-22 18:17:05 -0800 | [diff] [blame] | 54 | RsContext rsContextCreate(RsDevice dev, uint32_t version, uint32_t sdkVersion, |
| 55 | RsContextType ct, bool forceCpu, bool synchronous); |
Alex Sakhartchouk | 31aca7d | 2011-10-18 11:08:31 -0700 | [diff] [blame] | 56 | RsContext rsContextCreateGL(RsDevice dev, uint32_t version, uint32_t sdkVersion, |
| 57 | RsSurfaceConfig sc, uint32_t dpi); |
Jason Sams | 789ca83 | 2011-05-18 17:36:02 -0700 | [diff] [blame] | 58 | |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 59 | #include "rsgApiFuncDecl.h" |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 60 | |
Jason Sams | 326e0dd | 2009-05-22 14:03:28 -0700 | [diff] [blame] | 61 | #endif // RENDER_SCRIPT_H |
| 62 | |
| 63 | |
| 64 | |