RenderScriptpublic class RenderScript extends Object This class provides access to a RenderScript context, which controls RenderScript
initialization, resource management, and teardown. An instance of the RenderScript
class must be created before any other RS objects can be created.
Developer Guides
For more information about creating an application that uses RenderScript, read the
RenderScript developer guide.
|
Fields Summary |
---|
static final long | TRACE_TAG | static final String | LOG_TAG | static final boolean | DEBUG | static final boolean | LOG_ENABLED | private android.content.Context | mApplicationContext | static boolean | sInitialized | static Object | sRuntime | static Method | registerNativeAllocation | static Method | registerNativeFree | public static final int | CREATE_FLAG_NONE | public static final int | CREATE_FLAG_LOW_LATENCY | public static final int | CREATE_FLAG_LOW_POWER | static int | sPointerSize | static File | mCacheDir | static final long | sMinorID | ContextType | mContextType | ReentrantReadWriteLock | mRWLock | long | mDev | long | mContext | MessageThread | mMessageThread | Element | mElement_U8 | Element | mElement_I8 | Element | mElement_U16 | Element | mElement_I16 | Element | mElement_U32 | Element | mElement_I32 | Element | mElement_U64 | Element | mElement_I64 | Element | mElement_F32 | Element | mElement_F64 | Element | mElement_BOOLEAN | Element | mElement_ELEMENT | Element | mElement_TYPE | Element | mElement_ALLOCATION | Element | mElement_SAMPLER | Element | mElement_SCRIPT | Element | mElement_MESH | Element | mElement_PROGRAM_FRAGMENT | Element | mElement_PROGRAM_VERTEX | Element | mElement_PROGRAM_RASTER | Element | mElement_PROGRAM_STORE | Element | mElement_FONT | Element | mElement_A_8 | Element | mElement_RGB_565 | Element | mElement_RGB_888 | Element | mElement_RGBA_5551 | Element | mElement_RGBA_4444 | Element | mElement_RGBA_8888 | Element | mElement_FLOAT_2 | Element | mElement_FLOAT_3 | Element | mElement_FLOAT_4 | Element | mElement_DOUBLE_2 | Element | mElement_DOUBLE_3 | Element | mElement_DOUBLE_4 | Element | mElement_UCHAR_2 | Element | mElement_UCHAR_3 | Element | mElement_UCHAR_4 | Element | mElement_CHAR_2 | Element | mElement_CHAR_3 | Element | mElement_CHAR_4 | Element | mElement_USHORT_2 | Element | mElement_USHORT_3 | Element | mElement_USHORT_4 | Element | mElement_SHORT_2 | Element | mElement_SHORT_3 | Element | mElement_SHORT_4 | Element | mElement_UINT_2 | Element | mElement_UINT_3 | Element | mElement_UINT_4 | Element | mElement_INT_2 | Element | mElement_INT_3 | Element | mElement_INT_4 | Element | mElement_ULONG_2 | Element | mElement_ULONG_3 | Element | mElement_ULONG_4 | Element | mElement_LONG_2 | Element | mElement_LONG_3 | Element | mElement_LONG_4 | Element | mElement_YUV | Element | mElement_MATRIX_4X4 | Element | mElement_MATRIX_3X3 | Element | mElement_MATRIX_2X2 | Sampler | mSampler_CLAMP_NEAREST | Sampler | mSampler_CLAMP_LINEAR | Sampler | mSampler_CLAMP_LINEAR_MIP_LINEAR | Sampler | mSampler_WRAP_NEAREST | Sampler | mSampler_WRAP_LINEAR | Sampler | mSampler_WRAP_LINEAR_MIP_LINEAR | Sampler | mSampler_MIRRORED_REPEAT_NEAREST | Sampler | mSampler_MIRRORED_REPEAT_LINEAR | Sampler | mSampler_MIRRORED_REPEAT_LINEAR_MIP_LINEAR | ProgramStore | mProgramStore_BLEND_NONE_DEPTH_TEST | ProgramStore | mProgramStore_BLEND_NONE_DEPTH_NO_DEPTH | ProgramStore | mProgramStore_BLEND_ALPHA_DEPTH_TEST | ProgramStore | mProgramStore_BLEND_ALPHA_DEPTH_NO_DEPTH | ProgramRaster | mProgramRaster_CULL_BACK | ProgramRaster | mProgramRaster_CULL_FRONT | ProgramRaster | mProgramRaster_CULL_NONE | RSMessageHandler | mMessageCallbackIf an application is expecting messages, it should set this
field to an instance of {@link RSMessageHandler}. This
instance will receive all the user messages sent from {@code
sendToClient} by scripts from this context. | RSErrorHandler | mErrorCallbackApplication Error handler. All runtime errors will be dispatched to the
instance of RSAsyncError set here. If this field is null a
{@link RSRuntimeException} will instead be thrown with details about the error.
This will cause program termaination. |
Constructors Summary |
---|
RenderScript(android.content.Context ctx)
mContextType = ContextType.NORMAL;
if (ctx != null) {
mApplicationContext = ctx.getApplicationContext();
}
mRWLock = new ReentrantReadWriteLock();
try {
registerNativeAllocation.invoke(sRuntime, 4 * 1024 * 1024); // 4MB for GC sake
} catch (Exception e) {
Log.e(RenderScript.LOG_TAG, "Couldn't invoke registerNativeAllocation:" + e);
throw new RSRuntimeException("Couldn't invoke registerNativeAllocation:" + e);
}
|
Methods Summary |
---|
static native void | _nInit()
| public void | contextDump()Print the currently available debugging information about the state of
the RS context to the log.
validate();
nContextDump(0);
| public static android.renderscript.RenderScript | create(android.content.Context ctx, int sdkVersion)
return create(ctx, sdkVersion, ContextType.NORMAL, CREATE_FLAG_NONE);
| public static android.renderscript.RenderScript | create(android.content.Context ctx, int sdkVersion, android.renderscript.RenderScript$ContextType ct, int flags)Create a RenderScript context.
if (!sInitialized) {
Log.e(LOG_TAG, "RenderScript.create() called when disabled; someone is likely to crash");
return null;
}
if ((flags & ~(CREATE_FLAG_LOW_LATENCY | CREATE_FLAG_LOW_POWER)) != 0) {
throw new RSIllegalArgumentException("Invalid flags passed.");
}
RenderScript rs = new RenderScript(ctx);
rs.mDev = rs.nDeviceCreate();
rs.mContext = rs.nContextCreate(rs.mDev, flags, sdkVersion, ct.mID);
rs.mContextType = ct;
if (rs.mContext == 0) {
throw new RSDriverException("Failed to create RS context.");
}
rs.mMessageThread = new MessageThread(rs);
rs.mMessageThread.start();
return rs;
| public static android.renderscript.RenderScript | create(android.content.Context ctx)Create a RenderScript context.
return create(ctx, ContextType.NORMAL);
| public static android.renderscript.RenderScript | create(android.content.Context ctx, android.renderscript.RenderScript$ContextType ct)Create a RenderScript context.
int v = ctx.getApplicationInfo().targetSdkVersion;
return create(ctx, v, ct, CREATE_FLAG_NONE);
| public static android.renderscript.RenderScript | create(android.content.Context ctx, android.renderscript.RenderScript$ContextType ct, int flags)Create a RenderScript context.
int v = ctx.getApplicationInfo().targetSdkVersion;
return create(ctx, v, ct, flags);
| public void | destroy()Destroys this RenderScript context. Once this function is called,
using this context or any objects belonging to this context is
illegal.
validate();
nContextFinish();
nContextDeinitToClient(mContext);
mMessageThread.mRun = false;
try {
mMessageThread.join();
} catch(InterruptedException e) {
}
nContextDestroy();
nDeviceDestroy(mDev);
mDev = 0;
| public void | finish()Wait for any pending asynchronous opeations (such as copies to a RS
allocation or RS script executions) to complete.
nContextFinish();
| public final android.content.Context | getApplicationContext()Gets the application context associated with the RenderScript context.
return mApplicationContext;
| public android.renderscript.RenderScript$RSErrorHandler | getErrorHandler()
return mErrorCallback;
| public android.renderscript.RenderScript$RSMessageHandler | getMessageHandler()
return mMessageCallback;
| public static long | getMinorID()Returns an identifier that can be used to identify a particular
minor version of RS.
return sMinorID;
| boolean | isAlive()
return mContext != 0;
| synchronized void | nAllocationCopyFromBitmap(long alloc, android.graphics.Bitmap bmp)
validate();
rsnAllocationCopyFromBitmap(mContext, alloc, bmp);
| synchronized void | nAllocationCopyToBitmap(long alloc, android.graphics.Bitmap bmp)
validate();
rsnAllocationCopyToBitmap(mContext, alloc, bmp);
| synchronized long | nAllocationCreateBitmapBackedAllocation(long type, int mip, android.graphics.Bitmap bmp, int usage)
validate();
return rsnAllocationCreateBitmapBackedAllocation(mContext, type, mip, bmp, usage);
| synchronized long | nAllocationCreateBitmapRef(long type, android.graphics.Bitmap bmp)
validate();
return rsnAllocationCreateBitmapRef(mContext, type, bmp);
| synchronized long | nAllocationCreateFromAssetStream(int mips, int assetStream, int usage)
validate();
return rsnAllocationCreateFromAssetStream(mContext, mips, assetStream, usage);
| synchronized long | nAllocationCreateFromBitmap(long type, int mip, android.graphics.Bitmap bmp, int usage)
validate();
return rsnAllocationCreateFromBitmap(mContext, type, mip, bmp, usage);
| synchronized long | nAllocationCreateTyped(long type, int mip, int usage, long pointer)
validate();
return rsnAllocationCreateTyped(mContext, type, mip, usage, pointer);
| synchronized long | nAllocationCubeCreateFromBitmap(long type, int mip, android.graphics.Bitmap bmp, int usage)
validate();
return rsnAllocationCubeCreateFromBitmap(mContext, type, mip, bmp, usage);
| synchronized void | nAllocationData1D(long id, int off, int mip, int count, java.lang.Object d, int sizeBytes, Element.DataType dt)
validate();
rsnAllocationData1D(mContext, id, off, mip, count, d, sizeBytes, dt.mID);
| synchronized void | nAllocationData2D(long id, int xoff, int yoff, int mip, int face, int w, int h, java.lang.Object d, int sizeBytes, Element.DataType dt)
validate();
rsnAllocationData2D(mContext, id, xoff, yoff, mip, face, w, h, d, sizeBytes, dt.mID);
| synchronized void | nAllocationData2D(long id, int xoff, int yoff, int mip, int face, android.graphics.Bitmap b)
validate();
rsnAllocationData2D(mContext, id, xoff, yoff, mip, face, b);
| synchronized void | nAllocationData2D(long dstAlloc, int dstXoff, int dstYoff, int dstMip, int dstFace, int width, int height, long srcAlloc, int srcXoff, int srcYoff, int srcMip, int srcFace)
validate();
rsnAllocationData2D(mContext,
dstAlloc, dstXoff, dstYoff,
dstMip, dstFace,
width, height,
srcAlloc, srcXoff, srcYoff,
srcMip, srcFace);
| synchronized void | nAllocationData3D(long dstAlloc, int dstXoff, int dstYoff, int dstZoff, int dstMip, int width, int height, int depth, long srcAlloc, int srcXoff, int srcYoff, int srcZoff, int srcMip)
validate();
rsnAllocationData3D(mContext,
dstAlloc, dstXoff, dstYoff, dstZoff,
dstMip, width, height, depth,
srcAlloc, srcXoff, srcYoff, srcZoff, srcMip);
| synchronized void | nAllocationData3D(long id, int xoff, int yoff, int zoff, int mip, int w, int h, int depth, java.lang.Object d, int sizeBytes, Element.DataType dt)
validate();
rsnAllocationData3D(mContext, id, xoff, yoff, zoff, mip, w, h, depth, d, sizeBytes, dt.mID);
| synchronized void | nAllocationElementData1D(long id, int xoff, int mip, int compIdx, byte[] d, int sizeBytes)
validate();
rsnAllocationElementData1D(mContext, id, xoff, mip, compIdx, d, sizeBytes);
| synchronized void | nAllocationGenerateMipmaps(long alloc)
validate();
rsnAllocationGenerateMipmaps(mContext, alloc);
| synchronized android.view.Surface | nAllocationGetSurface(long alloc)
validate();
return rsnAllocationGetSurface(mContext, alloc);
| synchronized long | nAllocationGetType(long id)
validate();
return rsnAllocationGetType(mContext, id);
| synchronized void | nAllocationIoReceive(long alloc)
validate();
rsnAllocationIoReceive(mContext, alloc);
| synchronized void | nAllocationIoSend(long alloc)
validate();
rsnAllocationIoSend(mContext, alloc);
| synchronized void | nAllocationRead(long id, java.lang.Object d, Element.DataType dt)
validate();
rsnAllocationRead(mContext, id, d, dt.mID);
| synchronized void | nAllocationRead1D(long id, int off, int mip, int count, java.lang.Object d, int sizeBytes, Element.DataType dt)
validate();
rsnAllocationRead1D(mContext, id, off, mip, count, d, sizeBytes, dt.mID);
| synchronized void | nAllocationRead2D(long id, int xoff, int yoff, int mip, int face, int w, int h, java.lang.Object d, int sizeBytes, Element.DataType dt)
validate();
rsnAllocationRead2D(mContext, id, xoff, yoff, mip, face, w, h, d, sizeBytes, dt.mID);
| synchronized void | nAllocationResize1D(long id, int dimX)
validate();
rsnAllocationResize1D(mContext, id, dimX);
| synchronized void | nAllocationSetSurface(long alloc, android.view.Surface sur)
validate();
rsnAllocationSetSurface(mContext, alloc, sur);
| synchronized void | nAllocationSyncAll(long alloc, int src)
validate();
rsnAllocationSyncAll(mContext, alloc, src);
| synchronized void | nAssignName(long obj, byte[] name)
validate();
rsnAssignName(mContext, obj, name);
| synchronized void | nContextBindProgramFragment(long pf)
validate();
rsnContextBindProgramFragment(mContext, pf);
| synchronized void | nContextBindProgramRaster(long pr)
validate();
rsnContextBindProgramRaster(mContext, pr);
| synchronized void | nContextBindProgramStore(long pfs)
validate();
rsnContextBindProgramStore(mContext, pfs);
| synchronized void | nContextBindProgramVertex(long pv)
validate();
rsnContextBindProgramVertex(mContext, pv);
| synchronized void | nContextBindRootScript(long script)
validate();
rsnContextBindRootScript(mContext, script);
| synchronized void | nContextBindSampler(int sampler, int slot)
validate();
rsnContextBindSampler(mContext, sampler, slot);
| synchronized long | nContextCreate(long dev, int ver, int sdkVer, int contextType)
return rsnContextCreate(dev, ver, sdkVer, contextType);
| synchronized long | nContextCreateGL(long dev, int ver, int sdkVer, int colorMin, int colorPref, int alphaMin, int alphaPref, int depthMin, int depthPref, int stencilMin, int stencilPref, int samplesMin, int samplesPref, float samplesQ, int dpi)
return rsnContextCreateGL(dev, ver, sdkVer, colorMin, colorPref,
alphaMin, alphaPref, depthMin, depthPref,
stencilMin, stencilPref,
samplesMin, samplesPref, samplesQ, dpi);
| native void | nContextDeinitToClient(long con)
| synchronized void | nContextDestroy()
validate();
// take teardown lock
// teardown lock can only be taken when no objects are being destroyed
ReentrantReadWriteLock.WriteLock wlock = mRWLock.writeLock();
wlock.lock();
long curCon = mContext;
// context is considered dead as of this point
mContext = 0;
wlock.unlock();
rsnContextDestroy(curCon);
| synchronized void | nContextDump(int bits)
validate();
rsnContextDump(mContext, bits);
| synchronized void | nContextFinish()
validate();
rsnContextFinish(mContext);
| native java.lang.String | nContextGetErrorMessage(long con)
| native int | nContextGetUserMessage(long con, int[] data)
| native void | nContextInitToClient(long con)
| synchronized void | nContextPause()
validate();
rsnContextPause(mContext);
| native int | nContextPeekMessage(long con, int[] subID)
| synchronized void | nContextResume()
validate();
rsnContextResume(mContext);
| synchronized void | nContextSendMessage(int id, int[] data)
validate();
rsnContextSendMessage(mContext, id, data);
| synchronized void | nContextSetPriority(int p)
validate();
rsnContextSetPriority(mContext, p);
| synchronized void | nContextSetSurface(int w, int h, android.view.Surface sur)
validate();
rsnContextSetSurface(mContext, w, h, sur);
| synchronized void | nContextSetSurfaceTexture(int w, int h, android.graphics.SurfaceTexture sur)
validate();
rsnContextSetSurfaceTexture(mContext, w, h, sur);
| native long | nDeviceCreate()
| native void | nDeviceDestroy(long dev)
| native void | nDeviceSetConfig(long dev, int param, int value)
| synchronized long | nElementCreate(long type, int kind, boolean norm, int vecSize)
validate();
return rsnElementCreate(mContext, type, kind, norm, vecSize);
| synchronized long | nElementCreate2(long[] elements, java.lang.String[] names, int[] arraySizes)
validate();
return rsnElementCreate2(mContext, elements, names, arraySizes);
| synchronized void | nElementGetNativeData(long id, int[] elementData)
validate();
rsnElementGetNativeData(mContext, id, elementData);
| synchronized void | nElementGetSubElements(long id, long[] IDs, java.lang.String[] names, int[] arraySizes)
validate();
rsnElementGetSubElements(mContext, id, IDs, names, arraySizes);
| synchronized long | nFileA3DCreateFromAsset(android.content.res.AssetManager mgr, java.lang.String path)
validate();
return rsnFileA3DCreateFromAsset(mContext, mgr, path);
| synchronized long | nFileA3DCreateFromAssetStream(long assetStream)
validate();
return rsnFileA3DCreateFromAssetStream(mContext, assetStream);
| synchronized long | nFileA3DCreateFromFile(java.lang.String path)
validate();
return rsnFileA3DCreateFromFile(mContext, path);
| synchronized long | nFileA3DGetEntryByIndex(long fileA3D, int index)
validate();
return rsnFileA3DGetEntryByIndex(mContext, fileA3D, index);
| synchronized void | nFileA3DGetIndexEntries(long fileA3D, int numEntries, int[] IDs, java.lang.String[] names)
validate();
rsnFileA3DGetIndexEntries(mContext, fileA3D, numEntries, IDs, names);
| synchronized int | nFileA3DGetNumIndexEntries(long fileA3D)
validate();
return rsnFileA3DGetNumIndexEntries(mContext, fileA3D);
| synchronized long | nFontCreateFromAsset(android.content.res.AssetManager mgr, java.lang.String path, float size, int dpi)
validate();
return rsnFontCreateFromAsset(mContext, mgr, path, size, dpi);
| synchronized long | nFontCreateFromAssetStream(java.lang.String name, float size, int dpi, long assetStream)
validate();
return rsnFontCreateFromAssetStream(mContext, name, size, dpi, assetStream);
| synchronized long | nFontCreateFromFile(java.lang.String fileName, float size, int dpi)
validate();
return rsnFontCreateFromFile(mContext, fileName, size, dpi);
| synchronized java.lang.String | nGetName(long obj)
validate();
return rsnGetName(mContext, obj);
| synchronized long | nMeshCreate(long[] vtx, long[] idx, int[] prim)
validate();
return rsnMeshCreate(mContext, vtx, idx, prim);
| synchronized int | nMeshGetIndexCount(long id)
validate();
return rsnMeshGetIndexCount(mContext, id);
| synchronized void | nMeshGetIndices(long id, long[] idxIds, int[] primitives, int vtxIdCount)
validate();
rsnMeshGetIndices(mContext, id, idxIds, primitives, vtxIdCount);
| synchronized int | nMeshGetVertexBufferCount(long id)
validate();
return rsnMeshGetVertexBufferCount(mContext, id);
| synchronized void | nMeshGetVertices(long id, long[] vtxIds, int vtxIdCount)
validate();
rsnMeshGetVertices(mContext, id, vtxIds, vtxIdCount);
| void | nObjDestroy(long id)
// There is a race condition here. The calling code may be run
// by the gc while teardown is occuring. This protects againts
// deleting dead objects.
if (mContext != 0) {
rsnObjDestroy(mContext, id);
}
| synchronized long | nPathCreate(int prim, boolean isStatic, long vtx, long loop, float q)
validate();
return rsnPathCreate(mContext, prim, isStatic, vtx, loop, q);
| synchronized void | nProgramBindConstants(long pv, int slot, long mID)
validate();
rsnProgramBindConstants(mContext, pv, slot, mID);
| synchronized void | nProgramBindSampler(long vpf, int slot, long s)
validate();
rsnProgramBindSampler(mContext, vpf, slot, s);
| synchronized void | nProgramBindTexture(long vpf, int slot, long a)
validate();
rsnProgramBindTexture(mContext, vpf, slot, a);
| synchronized long | nProgramFragmentCreate(java.lang.String shader, java.lang.String[] texNames, long[] params)
validate();
return rsnProgramFragmentCreate(mContext, shader, texNames, params);
| synchronized long | nProgramRasterCreate(boolean pointSprite, int cullMode)
validate();
return rsnProgramRasterCreate(mContext, pointSprite, cullMode);
| synchronized long | nProgramStoreCreate(boolean r, boolean g, boolean b, boolean a, boolean depthMask, boolean dither, int srcMode, int dstMode, int depthFunc)
validate();
return rsnProgramStoreCreate(mContext, r, g, b, a, depthMask, dither, srcMode,
dstMode, depthFunc);
| synchronized long | nProgramVertexCreate(java.lang.String shader, java.lang.String[] texNames, long[] params)
validate();
return rsnProgramVertexCreate(mContext, shader, texNames, params);
| synchronized long | nSamplerCreate(int magFilter, int minFilter, int wrapS, int wrapT, int wrapR, float aniso)
validate();
return rsnSamplerCreate(mContext, magFilter, minFilter, wrapS, wrapT, wrapR, aniso);
| synchronized void | nScriptBindAllocation(long script, long alloc, int slot)
validate();
rsnScriptBindAllocation(mContext, script, alloc, slot);
| synchronized long | nScriptCCreate(java.lang.String resName, java.lang.String cacheDir, byte[] script, int length)
validate();
return rsnScriptCCreate(mContext, resName, cacheDir, script, length);
| synchronized long | nScriptFieldIDCreate(long sid, int slot)
validate();
return rsnScriptFieldIDCreate(mContext, sid, slot);
| synchronized void | nScriptForEach(long id, int slot, long ain, long aout, byte[] params)
validate();
if (params == null) {
rsnScriptForEach(mContext, id, slot, ain, aout);
} else {
rsnScriptForEach(mContext, id, slot, ain, aout, params);
}
| synchronized void | nScriptForEachClipped(long id, int slot, long ain, long aout, byte[] params, int xstart, int xend, int ystart, int yend, int zstart, int zend)
validate();
if (params == null) {
rsnScriptForEachClipped(mContext, id, slot, ain, aout, xstart, xend, ystart, yend, zstart, zend);
} else {
rsnScriptForEachClipped(mContext, id, slot, ain, aout, params, xstart, xend, ystart, yend, zstart, zend);
}
| synchronized void | nScriptForEachMultiClipped(long id, int slot, long[] ains, long aout, byte[] params, int xstart, int xend, int ystart, int yend, int zstart, int zend)
validate();
if (params == null) {
rsnScriptForEachMultiClipped(mContext, id, slot, ains, aout, xstart, xend, ystart, yend, zstart, zend);
} else {
rsnScriptForEachMultiClipped(mContext, id, slot, ains, aout, params, xstart, xend, ystart, yend, zstart, zend);
}
| synchronized double | nScriptGetVarD(long id, int slot)
validate();
return rsnScriptGetVarD(mContext, id, slot);
| synchronized float | nScriptGetVarF(long id, int slot)
validate();
return rsnScriptGetVarF(mContext, id, slot);
| synchronized int | nScriptGetVarI(long id, int slot)
validate();
return rsnScriptGetVarI(mContext, id, slot);
| synchronized long | nScriptGetVarJ(long id, int slot)
validate();
return rsnScriptGetVarJ(mContext, id, slot);
| synchronized void | nScriptGetVarV(long id, int slot, byte[] val)
validate();
rsnScriptGetVarV(mContext, id, slot, val);
| synchronized long | nScriptGroupCreate(long[] kernels, long[] src, long[] dstk, long[] dstf, long[] types)
validate();
return rsnScriptGroupCreate(mContext, kernels, src, dstk, dstf, types);
| synchronized void | nScriptGroupExecute(long group)
validate();
rsnScriptGroupExecute(mContext, group);
| synchronized void | nScriptGroupSetInput(long group, long kernel, long alloc)
validate();
rsnScriptGroupSetInput(mContext, group, kernel, alloc);
| synchronized void | nScriptGroupSetOutput(long group, long kernel, long alloc)
validate();
rsnScriptGroupSetOutput(mContext, group, kernel, alloc);
| synchronized long | nScriptIntrinsicCreate(int id, long eid)
validate();
return rsnScriptIntrinsicCreate(mContext, id, eid);
| synchronized void | nScriptInvoke(long id, int slot)
validate();
rsnScriptInvoke(mContext, id, slot);
| synchronized void | nScriptInvokeV(long id, int slot, byte[] params)
validate();
rsnScriptInvokeV(mContext, id, slot, params);
| synchronized long | nScriptKernelIDCreate(long sid, int slot, int sig)
validate();
return rsnScriptKernelIDCreate(mContext, sid, slot, sig);
| synchronized void | nScriptSetTimeZone(long script, byte[] timeZone)
validate();
rsnScriptSetTimeZone(mContext, script, timeZone);
| synchronized void | nScriptSetVarD(long id, int slot, double val)
validate();
rsnScriptSetVarD(mContext, id, slot, val);
| synchronized void | nScriptSetVarF(long id, int slot, float val)
validate();
rsnScriptSetVarF(mContext, id, slot, val);
| synchronized void | nScriptSetVarI(long id, int slot, int val)
validate();
rsnScriptSetVarI(mContext, id, slot, val);
| synchronized void | nScriptSetVarJ(long id, int slot, long val)
validate();
rsnScriptSetVarJ(mContext, id, slot, val);
| synchronized void | nScriptSetVarObj(long id, int slot, long val)
validate();
rsnScriptSetVarObj(mContext, id, slot, val);
| synchronized void | nScriptSetVarV(long id, int slot, byte[] val)
validate();
rsnScriptSetVarV(mContext, id, slot, val);
| synchronized void | nScriptSetVarVE(long id, int slot, byte[] val, long e, int[] dims)
validate();
rsnScriptSetVarVE(mContext, id, slot, val, e, dims);
| synchronized long | nTypeCreate(long eid, int x, int y, int z, boolean mips, boolean faces, int yuv)
validate();
return rsnTypeCreate(mContext, eid, x, y, z, mips, faces, yuv);
| synchronized void | nTypeGetNativeData(long id, long[] typeData)
validate();
rsnTypeGetNativeData(mContext, id, typeData);
| native void | rsnAllocationCopyFromBitmap(long con, long alloc, android.graphics.Bitmap bmp)
| native void | rsnAllocationCopyToBitmap(long con, long alloc, android.graphics.Bitmap bmp)
| native long | rsnAllocationCreateBitmapBackedAllocation(long con, long type, int mip, android.graphics.Bitmap bmp, int usage)
| native long | rsnAllocationCreateBitmapRef(long con, long type, android.graphics.Bitmap bmp)
| native long | rsnAllocationCreateFromAssetStream(long con, int mips, int assetStream, int usage)
| native long | rsnAllocationCreateFromBitmap(long con, long type, int mip, android.graphics.Bitmap bmp, int usage)
| native long | rsnAllocationCreateTyped(long con, long type, int mip, int usage, long pointer)
| native long | rsnAllocationCubeCreateFromBitmap(long con, long type, int mip, android.graphics.Bitmap bmp, int usage)
| native void | rsnAllocationData1D(long con, long id, int off, int mip, int count, java.lang.Object d, int sizeBytes, int dt)
| native void | rsnAllocationData2D(long con, long id, int xoff, int yoff, int mip, int face, android.graphics.Bitmap b)
| native void | rsnAllocationData2D(long con, long dstAlloc, int dstXoff, int dstYoff, int dstMip, int dstFace, int width, int height, long srcAlloc, int srcXoff, int srcYoff, int srcMip, int srcFace)
| native void | rsnAllocationData2D(long con, long id, int xoff, int yoff, int mip, int face, int w, int h, java.lang.Object d, int sizeBytes, int dt)
| native void | rsnAllocationData3D(long con, long dstAlloc, int dstXoff, int dstYoff, int dstZoff, int dstMip, int width, int height, int depth, long srcAlloc, int srcXoff, int srcYoff, int srcZoff, int srcMip)
| native void | rsnAllocationData3D(long con, long id, int xoff, int yoff, int zoff, int mip, int w, int h, int depth, java.lang.Object d, int sizeBytes, int dt)
| native void | rsnAllocationElementData1D(long con, long id, int xoff, int mip, int compIdx, byte[] d, int sizeBytes)
| native void | rsnAllocationGenerateMipmaps(long con, long alloc)
| native android.view.Surface | rsnAllocationGetSurface(long con, long alloc)
| native long | rsnAllocationGetType(long con, long id)
| native void | rsnAllocationIoReceive(long con, long alloc)
| native void | rsnAllocationIoSend(long con, long alloc)
| native void | rsnAllocationRead(long con, long id, java.lang.Object d, int dt)
| native void | rsnAllocationRead1D(long con, long id, int off, int mip, int count, java.lang.Object d, int sizeBytes, int dt)
| native void | rsnAllocationRead2D(long con, long id, int xoff, int yoff, int mip, int face, int w, int h, java.lang.Object d, int sizeBytes, int dt)
| native void | rsnAllocationResize1D(long con, long id, int dimX)
| native void | rsnAllocationSetSurface(long con, long alloc, android.view.Surface sur)
| native void | rsnAllocationSyncAll(long con, long alloc, int src)
| native void | rsnAssignName(long con, long obj, byte[] name)
| native void | rsnContextBindProgramFragment(long con, long pf)
| native void | rsnContextBindProgramRaster(long con, long pr)
| native void | rsnContextBindProgramStore(long con, long pfs)
| native void | rsnContextBindProgramVertex(long con, long pv)
| native void | rsnContextBindRootScript(long con, long script)
| native void | rsnContextBindSampler(long con, int sampler, int slot)
| native long | rsnContextCreate(long dev, int ver, int sdkVer, int contextType)
| native long | rsnContextCreateGL(long dev, int ver, int sdkVer, int colorMin, int colorPref, int alphaMin, int alphaPref, int depthMin, int depthPref, int stencilMin, int stencilPref, int samplesMin, int samplesPref, float samplesQ, int dpi)
| native void | rsnContextDestroy(long con)
| native void | rsnContextDump(long con, int bits)
| native void | rsnContextFinish(long con)
| native void | rsnContextPause(long con)
| native void | rsnContextResume(long con)
| native void | rsnContextSendMessage(long con, int id, int[] data)
| native void | rsnContextSetPriority(long con, int p)
| native void | rsnContextSetSurface(long con, int w, int h, android.view.Surface sur)
| native void | rsnContextSetSurfaceTexture(long con, int w, int h, android.graphics.SurfaceTexture sur)
| native long | rsnElementCreate(long con, long type, int kind, boolean norm, int vecSize)
| native long | rsnElementCreate2(long con, long[] elements, java.lang.String[] names, int[] arraySizes)
| native void | rsnElementGetNativeData(long con, long id, int[] elementData)
| native void | rsnElementGetSubElements(long con, long id, long[] IDs, java.lang.String[] names, int[] arraySizes)
| native long | rsnFileA3DCreateFromAsset(long con, android.content.res.AssetManager mgr, java.lang.String path)
| native long | rsnFileA3DCreateFromAssetStream(long con, long assetStream)
| native long | rsnFileA3DCreateFromFile(long con, java.lang.String path)
| native long | rsnFileA3DGetEntryByIndex(long con, long fileA3D, int index)
| native void | rsnFileA3DGetIndexEntries(long con, long fileA3D, int numEntries, int[] IDs, java.lang.String[] names)
| native int | rsnFileA3DGetNumIndexEntries(long con, long fileA3D)
| native long | rsnFontCreateFromAsset(long con, android.content.res.AssetManager mgr, java.lang.String path, float size, int dpi)
| native long | rsnFontCreateFromAssetStream(long con, java.lang.String name, float size, int dpi, long assetStream)
| native long | rsnFontCreateFromFile(long con, java.lang.String fileName, float size, int dpi)
| native java.lang.String | rsnGetName(long con, long obj)
| native long | rsnMeshCreate(long con, long[] vtx, long[] idx, int[] prim)
| native int | rsnMeshGetIndexCount(long con, long id)
| native void | rsnMeshGetIndices(long con, long id, long[] idxIds, int[] primitives, int vtxIdCount)
| native int | rsnMeshGetVertexBufferCount(long con, long id)
| native void | rsnMeshGetVertices(long con, long id, long[] vtxIds, int vtxIdCount)
| native void | rsnObjDestroy(long con, long id)
| native long | rsnPathCreate(long con, int prim, boolean isStatic, long vtx, long loop, float q)
| native void | rsnProgramBindConstants(long con, long pv, int slot, long mID)
| native void | rsnProgramBindSampler(long con, long vpf, int slot, long s)
| native void | rsnProgramBindTexture(long con, long vpf, int slot, long a)
| native long | rsnProgramFragmentCreate(long con, java.lang.String shader, java.lang.String[] texNames, long[] params)
| native long | rsnProgramRasterCreate(long con, boolean pointSprite, int cullMode)
| native long | rsnProgramStoreCreate(long con, boolean r, boolean g, boolean b, boolean a, boolean depthMask, boolean dither, int srcMode, int dstMode, int depthFunc)
| native long | rsnProgramVertexCreate(long con, java.lang.String shader, java.lang.String[] texNames, long[] params)
| native long | rsnSamplerCreate(long con, int magFilter, int minFilter, int wrapS, int wrapT, int wrapR, float aniso)
| native void | rsnScriptBindAllocation(long con, long script, long alloc, int slot)
| native long | rsnScriptCCreate(long con, java.lang.String resName, java.lang.String cacheDir, byte[] script, int length)
| native long | rsnScriptFieldIDCreate(long con, long sid, int slot)
| native void | rsnScriptForEach(long con, long id, int slot, long ain, long aout, byte[] params)
| native void | rsnScriptForEach(long con, long id, int slot, long ain, long aout)
| native void | rsnScriptForEachClipped(long con, long id, int slot, long ain, long aout, byte[] params, int xstart, int xend, int ystart, int yend, int zstart, int zend)
| native void | rsnScriptForEachClipped(long con, long id, int slot, long ain, long aout, int xstart, int xend, int ystart, int yend, int zstart, int zend)
| native void | rsnScriptForEachMultiClipped(long con, long id, int slot, long[] ains, long aout, byte[] params, int xstart, int xend, int ystart, int yend, int zstart, int zend)Multi-input code.
| native void | rsnScriptForEachMultiClipped(long con, long id, int slot, long[] ains, long aout, int xstart, int xend, int ystart, int yend, int zstart, int zend)
| native double | rsnScriptGetVarD(long con, long id, int slot)
| native float | rsnScriptGetVarF(long con, long id, int slot)
| native int | rsnScriptGetVarI(long con, long id, int slot)
| native long | rsnScriptGetVarJ(long con, long id, int slot)
| native void | rsnScriptGetVarV(long con, long id, int slot, byte[] val)
| native long | rsnScriptGroupCreate(long con, long[] kernels, long[] src, long[] dstk, long[] dstf, long[] types)
| native void | rsnScriptGroupExecute(long con, long group)
| native void | rsnScriptGroupSetInput(long con, long group, long kernel, long alloc)
| native void | rsnScriptGroupSetOutput(long con, long group, long kernel, long alloc)
| native long | rsnScriptIntrinsicCreate(long con, int id, long eid)
| native void | rsnScriptInvoke(long con, long id, int slot)
| native void | rsnScriptInvokeV(long con, long id, int slot, byte[] params)
| native long | rsnScriptKernelIDCreate(long con, long sid, int slot, int sig)
| native void | rsnScriptSetTimeZone(long con, long script, byte[] timeZone)
| native void | rsnScriptSetVarD(long con, long id, int slot, double val)
| native void | rsnScriptSetVarF(long con, long id, int slot, float val)
| native void | rsnScriptSetVarI(long con, long id, int slot, int val)
| native void | rsnScriptSetVarJ(long con, long id, int slot, long val)
| native void | rsnScriptSetVarObj(long con, long id, int slot, long val)
| native void | rsnScriptSetVarV(long con, long id, int slot, byte[] val)
| native void | rsnScriptSetVarVE(long con, long id, int slot, byte[] val, long e, int[] dims)
| static native int | rsnSystemGetPointerSize()
| native long | rsnTypeCreate(long con, long eid, int x, int y, int z, boolean mips, boolean faces, int yuv)
| native void | rsnTypeGetNativeData(long con, long id, long[] typeData)
| long | safeID(BaseObj o)
if(o != null) {
return o.getID(this);
}
return 0;
| public void | sendMessage(int id, int[] data)Place a message into the message queue to be sent back to the message
handler once all previous commands have been executed.
nContextSendMessage(id, data);
| public void | setErrorHandler(android.renderscript.RenderScript$RSErrorHandler msg)
mErrorCallback = msg;
| public void | setMessageHandler(android.renderscript.RenderScript$RSMessageHandler msg)
mMessageCallback = msg;
| public void | setPriority(android.renderscript.RenderScript$Priority p)Change the priority of the worker threads for this context.
validate();
nContextSetPriority(p.mID);
| public static void | setupDiskCache(java.io.File cacheDir)Sets the directory to use as a persistent storage for the
renderscript object file cache.
if (!sInitialized) {
Log.e(LOG_TAG, "RenderScript.setupDiskCache() called when disabled");
return;
}
// Defer creation of cache path to nScriptCCreate().
mCacheDir = cacheDir;
| void | validate()
if (mContext == 0) {
throw new RSInvalidStateException("Calling RS with no Context active.");
}
| void | validateObject(BaseObj o)
if (o != null) {
if (o.mRS != this) {
throw new RSIllegalArgumentException("Attempting to use an object across contexts.");
}
}
|
|