public static final class ScriptGroup.Builder extends Object
First all the Kernels to be used by the group should be added. Once this is done the kernels should be connected. Kernels cannot be added once a connection has been made.
Second, add connections. There are two forms of connections. Kernel to Kernel and Kernel to Field. Kernel to Kernel is higher performance and should be used where possible. The line of connections cannot form a loop. If a loop is detected an exception is thrown.
Once all the connections are made a call to create will return the ScriptGroup object.
Constructor and Description |
---|
ScriptGroup.Builder(RenderScript rs)
Create a builder for generating a ScriptGroup.
|
Modifier and Type | Method and Description |
---|---|
ScriptGroup.Builder |
addConnection(Type t,
Script.KernelID from,
Script.FieldID to)
Adds a connection to the group.
|
ScriptGroup.Builder |
addConnection(Type t,
Script.KernelID from,
Script.KernelID to)
Adds a connection to the group.
|
ScriptGroup.Builder |
addKernel(Script.KernelID k)
Adds a Kernel to the group.
|
ScriptGroup |
create()
Creates the Script group.
|
public ScriptGroup.Builder(RenderScript rs)
rs
- The Renderscript context.public ScriptGroup.Builder addKernel(Script.KernelID k)
k
- The kernel to add.public ScriptGroup.Builder addConnection(Type t, Script.KernelID from, Script.FieldID to)
t
- The type of the connection. This is used to
determine the kernel launch sizes on the source side
of this connection.from
- The source for the connection.to
- The destination of the connection.public ScriptGroup.Builder addConnection(Type t, Script.KernelID from, Script.KernelID to)
t
- The type of the connection. This is used to
determine the kernel launch sizes for both sides of
this connection.from
- The source for the connection.to
- The destination of the connection.public ScriptGroup create()