diff options
author | Alex Sakhartchouk <alexst@google.com> | 2010-07-15 11:33:03 -0700 |
---|---|---|
committer | Alex Sakhartchouk <alexst@google.com> | 2010-07-15 14:02:54 -0700 |
commit | dfac814c18f73dd7289f9927edca3e3b6ec6bc00 (patch) | |
tree | 386ca04866a3e7be79ae621582222a8f2b09ceda /libs/rs/rsElement.cpp | |
parent | 506821b406181ff9b9a10c2fc078d16b79a8cf92 (diff) | |
download | frameworks_base-dfac814c18f73dd7289f9927edca3e3b6ec6bc00.zip frameworks_base-dfac814c18f73dd7289f9927edca3e3b6ec6bc00.tar.gz frameworks_base-dfac814c18f73dd7289f9927edca3e3b6ec6bc00.tar.bz2 |
Populate java objects with native data from a3d file.
Remove legacy constructor from programraster
Make a3d object creation synchronous
Change-Id: Ic7d7547cf6eee6f9a7c6e3ee12cd104e80056a7b
Diffstat (limited to 'libs/rs/rsElement.cpp')
-rw-r--r-- | libs/rs/rsElement.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/libs/rs/rsElement.cpp b/libs/rs/rsElement.cpp index aa20275..37b8bd6 100644 --- a/libs/rs/rsElement.cpp +++ b/libs/rs/rsElement.cpp @@ -293,6 +293,32 @@ RsElement rsi_ElementCreate2(Context *rsc, return (RsElement)e; } +void rsi_ElementGetNativeData(Context *rsc, RsElement elem, uint32_t *elemData, uint32_t elemDataSize) +{ + rsAssert(elemDataSize == 5); + // we will pack mType; mKind; mNormalized; mVectorSize; NumSubElements + 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(); + +} + +void rsi_ElementGetSubElements(Context *rsc, RsElement elem, uint32_t *ids, const char **names, uint32_t dataSize) +{ + Element *e = static_cast<Element *>(elem); + rsAssert(e->getFieldCount() == dataSize); + + for(uint32_t i = 0; i < dataSize; i ++) { + ids[i] = (uint32_t)e->getField(i); + names[i] = e->getFieldName(i); + } + +} + } } |