ScriptC::ScriptC(sp<RS> rs,
                 const void *codeTxt, size_t codeLength,
                 const char *cachedName, size_t cachedNameLength,
                 const char *cacheDir, size_t cacheDirLength)
: Script(NULL, rs) {
    mID = RS::dispatch->ScriptCCreate(rs->getContext(), cachedName, cachedNameLength,
                                      cacheDir, cacheDirLength, (const char *)codeTxt, codeLength);
}
sp<Allocation> Allocation::createTyped(sp<RS> rs, sp<const Type> type,
                                    RsAllocationMipmapControl mipmaps, uint32_t usage) {
    void *id = 0;
    if (rs->getError() == RS_SUCCESS) {
        id = RS::dispatch->AllocationCreateTyped(rs->getContext(), type->getID(), mipmaps, usage, 0);
    }
    if (id == 0) {
        rs->throwError(RS_ERROR_RUNTIME_ERROR, "Allocation creation failed");
        return nullptr;
    }
    return new Allocation(id, rs, type, usage);
}
Example #3
0
ScriptIntrinsic::ScriptIntrinsic(sp<RS> rs, int id, sp<const Element> e)
    : Script(nullptr, rs) {
    mID = createDispatch(rs, RS::dispatch->ScriptIntrinsicCreate(rs->getContext(), id,
                         e != nullptr ? e->getID() : 0));
    mElement = e;
}