rs.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. #ifndef RENDER_SCRIPT_H
  17. #define RENDER_SCRIPT_H
  18. #include <stdint.h>
  19. #include <sys/types.h>
  20. #include "rsInternalDefines.h"
  21. extern "C" {
  22. // Legacy graphics functions
  23. RsObjectBase rsaFileA3DGetEntryByIndex(RsContext, uint32_t idx, RsFile);
  24. RsFile rsaFileA3DCreateFromMemory(RsContext, const void *data,
  25. uint32_t len);
  26. RsFile rsaFileA3DCreateFromAsset(RsContext, void *asset);
  27. RsFile rsaFileA3DCreateFromFile(RsContext, const char *path);
  28. void rsaFileA3DGetNumIndexEntries(RsContext, int32_t *numEntries, RsFile);
  29. void rsaFileA3DGetIndexEntries(RsContext, RsFileIndexEntry *fileEntries,
  30. uint32_t numEntries, RsFile);
  31. // Mesh update functions
  32. void rsaMeshGetVertexBufferCount(RsContext, RsMesh, int32_t *vtxCount);
  33. void rsaMeshGetIndexCount(RsContext, RsMesh, int32_t *idxCount);
  34. void rsaMeshGetVertices(RsContext, RsMesh, RsAllocation *vtxData,
  35. uint32_t vtxDataCount);
  36. void rsaMeshGetIndices(RsContext, RsMesh, RsAllocation *va,
  37. uint32_t *primType, uint32_t idxDataCount);
  38. RsContext rsContextCreateGL(RsDevice dev, uint32_t version,
  39. uint32_t sdkVersion, RsSurfaceConfig sc,
  40. uint32_t dpi);
  41. void rsaGetName(RsContext, void * obj, const char **name);
  42. // Allocation update
  43. const void* rsaAllocationGetType(RsContext con, RsAllocation va);
  44. // Type update
  45. void rsaTypeGetNativeData(RsContext, RsType, uintptr_t *typeData, uint32_t typeDataSize);
  46. // Element update
  47. void rsaElementGetNativeData(RsContext, RsElement, uintptr_t *elemData, uint32_t elemDataSize);
  48. void rsaElementGetSubElements(RsContext, RsElement, uintptr_t *ids, const char **names,
  49. uint32_t *arraySizes, uint32_t dataSize);
  50. RsDevice rsDeviceCreate();
  51. void rsDeviceDestroy(RsDevice dev);
  52. void rsDeviceSetConfig(RsDevice dev, RsDeviceParam p, int32_t value);
  53. RsContext rsContextCreate(RsDevice dev, uint32_t version, uint32_t sdkVersion,
  54. RsContextType ct, uint32_t flags);
  55. }
  56. #include "rsgApiFuncDecl.h"
  57. #endif // RENDER_SCRIPT_H