to top
Android APIs
public static final class

ScriptGroup.Builder

extends Object
java.lang.Object
   ↳ android.renderscript.ScriptGroup.Builder

Class Overview

Create a ScriptGroup. There are two steps to creating a ScriptGoup.

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.

Summary

Public Constructors
ScriptGroup.Builder(RenderScript rs)
Create a builder for generating a ScriptGroup.
Public Methods
ScriptGroup.Builder addConnection(Type t, Script.KernelID from, Script.KernelID to)
Adds a connection to the group.
ScriptGroup.Builder addConnection(Type t, Script.KernelID from, Script.FieldID 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.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ScriptGroup.Builder (RenderScript rs)

Added in API level 17

Create a builder for generating a ScriptGroup.

Parameters
rs The Renderscript context.

Public Methods

public ScriptGroup.Builder addConnection (Type t, Script.KernelID from, Script.KernelID to)

Added in API level 17

Adds a connection to the group.

Parameters
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.
Returns
  • Builder Returns this

public ScriptGroup.Builder addConnection (Type t, Script.KernelID from, Script.FieldID to)

Added in API level 17

Adds a connection to the group.

Parameters
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.
Returns
  • Builder Returns this

public ScriptGroup.Builder addKernel (Script.KernelID k)

Added in API level 17

Adds a Kernel to the group.

Parameters
k The kernel to add.
Returns
  • Builder Returns this.

public ScriptGroup create ()

Added in API level 17

Creates the Script group.

Returns
  • ScriptGroup The new ScriptGroup