ScriptGroup.Builder2
instead.@Deprecated public static final class ScriptGroup.Builder extends Object
First, all kernels to be used by the ScriptGroup should be added.
Second, add connections between kernels. There are two types of connections: kernel to kernel and kernel to field. Kernel to kernel allows a kernel's output to be passed to another kernel as input. Kernel to field allows the output of one kernel to be bound as a script global. Kernel to kernel is higher performance and should be used where possible.
A ScriptGroup must contain a single directed acyclic graph (DAG); it cannot contain cycles. Currently, all kernels used in a ScriptGroup must come from different Script objects. Additionally, all kernels in a ScriptGroup must have at least one input, output, or internal connection.
Once all connections are made, a call to create()
will
return the ScriptGroup object.
Constructor and Description |
---|
Builder(RenderScript rs)
Deprecated.
Create a Builder for generating a ScriptGroup.
|
Modifier and Type | Method and Description |
---|---|
ScriptGroup.Builder |
addConnection(Type t,
Script.KernelID from,
Script.FieldID to)
Deprecated.
Adds a connection to the group.
|
ScriptGroup.Builder |
addConnection(Type t,
Script.KernelID from,
Script.KernelID to)
Deprecated.
Adds a connection to the group.
|
ScriptGroup.Builder |
addKernel(Script.KernelID k)
Deprecated.
Adds a Kernel to the group.
|
ScriptGroup |
create()
Deprecated.
Creates the Script group.
|
public 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()