12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- #include "rsContext.h"
- namespace android {
- namespace renderscript {
- extern "C" void rsaElementGetNativeData(RsContext con, RsElement elem,
- uint32_t *elemData, uint32_t elemDataSize) {
- rsAssert(elemDataSize == 5);
-
- Element *e = static_cast<Element *>(elem);
- (*elemData++) = (uint32_t)e->getType();
- (*elemData++) = (uint32_t)e->getKind();
- (*elemData++) = e->getComponent().getIsNormalized() ? 1 : 0;
- (*elemData++) = e->getComponent().getVectorSize();
- (*elemData++) = e->getFieldCount();
- }
- extern "C" void rsaElementGetSubElements(RsContext con, RsElement elem, uintptr_t *ids,
- const char **names, size_t *arraySizes, uint32_t dataSize) {
- Element *e = static_cast<Element *>(elem);
- rsAssert(e->getFieldCount() == dataSize);
- for (uint32_t i = 0; i < dataSize; i ++) {
- e->getField(i)->incUserRef();
- ids[i] = (uintptr_t)e->getField(i);
- names[i] = e->getFieldName(i);
- arraySizes[i] = e->getFieldArraySize(i);
- }
- }
- }
- }
|