RenderScript
open classRenderScript
kotlin.Any | |
↳ | android.renderscript.RenderScript |
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.
Summary
Nested classes | |
---|---|
ContextType specifies the specific type of context to be created. |
|
RenderScript worker thread priority enumeration. |
|
open |
The runtime error handler base class. |
open |
The base class from which an application should derive in order to receive RS messages from scripts. |
Constants | |
---|---|
static Int | |
static Int | |
static Int |
Public methods | |
---|---|
open Unit |
Print the currently available debugging information about the state of the RS context to the log. |
open static RenderScript! |
calls create(ctx, ContextType.NORMAL, CREATE_FLAG_NONE) See documentation for @create for details |
open static RenderScript! |
create(ctx: Context!, ct: RenderScript.ContextType!) calls create(ctx, ct, CREATE_FLAG_NONE) See documentation for @create for details |
open static RenderScript! |
create(ctx: Context!, ct: RenderScript.ContextType!, flags: Int) Gets or creates a RenderScript context of the specified type. |
open static RenderScript! |
createMultiContext(ctx: Context!, ct: RenderScript.ContextType!, flags: Int, API_number: Int) Create a RenderScript context. |
open Unit |
destroy() Destroys this RenderScript context. |
open Unit |
finish() Wait for any pending asynchronous opeations (such as copies to a RS allocation or RS script executions) to complete. |
Context! |
Gets the application context associated with the RenderScript context. |
open RenderScript.RSErrorHandler! | |
open RenderScript.RSMessageHandler! | |
open static Long |
Returns an identifier that can be used to identify a particular minor version of RS. |
open static Unit |
Releases all the process contexts. |
open Unit |
sendMessage(id: Int, data: IntArray!) Place a message into the message queue to be sent back to the message handler once all previous commands have been executed. |
open Unit | |
open Unit | |
open Unit |
Change the priority of the worker threads for this context. |
Protected methods | |
---|---|
open Unit |
finalize() |
Constants
CREATE_FLAG_LOW_LATENCY
static valCREATE_FLAG_LOW_LATENCY: Int
Deprecated: Deprecated in Java.
Value: 2
CREATE_FLAG_LOW_POWER
static valCREATE_FLAG_LOW_POWER: Int
Deprecated: Deprecated in Java.
Value: 4
Public methods
contextDump
open funcontextDump(): Unit
Deprecated: Deprecated in Java.
Print the currently available debugging information about the state of the RS context to the log.
create
open static funcreate(ctx: Context!): RenderScript!
Deprecated: Deprecated in Java.
calls create(ctx, ContextType.NORMAL, CREATE_FLAG_NONE) See documentation for @create for details
Parameters | |
---|---|
ctx |
Context!: The context. |
Return | |
---|---|
RenderScript! |
RenderScript |
create
open static funcreate(
ctx: Context!,
ct: RenderScript.ContextType!
): RenderScript!
Deprecated: Deprecated in Java.
calls create(ctx, ct, CREATE_FLAG_NONE) See documentation for @create for details
Parameters | |
---|---|
ctx |
Context!: The context. |
ct |
RenderScript.ContextType!: The type of context to be created. |
Return | |
---|---|
RenderScript! |
RenderScript |
create
open static funcreate(
ctx: Context!,
ct: RenderScript.ContextType!,
flags: Int
): RenderScript!
Deprecated: Deprecated in Java.
Gets or creates a RenderScript context of the specified type. The returned context will be cached for future reuse within the process. When an application is finished using RenderScript it should call releaseAllContexts() A process context is a context designed for easy creation and lifecycle management. Multiple calls to this function will return the same object provided they are called with the same options. This allows it to be used any time a RenderScript context is needed. Prior to API 23 this always created a new context.
Parameters | |
---|---|
ctx |
Context!: The context. |
ct |
RenderScript.ContextType!: The type of context to be created. |
flags |
Int: The OR of the CREATE_FLAG_* options desired |
Return | |
---|---|
RenderScript! |
RenderScript |
createMultiContext
open static funcreateMultiContext(
ctx: Context!,
ct: RenderScript.ContextType!,
flags: Int,
API_number: Int
): RenderScript!
Deprecated: Deprecated in Java.
Create a RenderScript context. This is an advanced function intended for applications which need to create more than one RenderScript context to be used at the same time. If you need a single context please use create()
Parameters | |
---|---|
ctx |
Context!: The context. |
Return | |
---|---|
RenderScript! |
RenderScript |
destroy
open fundestroy(): Unit
Deprecated: Deprecated in Java.
Destroys this RenderScript context. Once this function is called, using this context or any objects belonging to this context is illegal. API 23+, this function is a NOP if the context was created with create(). Please use releaseAllContexts() to clean up contexts created with the create function.
finish
open funfinish(): Unit
Deprecated: Deprecated in Java.
Wait for any pending asynchronous opeations (such as copies to a RS allocation or RS script executions) to complete.
getApplicationContext
fungetApplicationContext(): Context!
Deprecated: Deprecated in Java.
Gets the application context associated with the RenderScript context.
Return | |
---|---|
Context! |
The application context. |
getErrorHandler
open fungetErrorHandler(): RenderScript.RSErrorHandler!
Deprecated: Deprecated in Java.
getMessageHandler
open fungetMessageHandler(): RenderScript.RSMessageHandler!
Deprecated: Deprecated in Java.
getMinorVersion
open static fungetMinorVersion(): Long
Deprecated: Deprecated in Java.
Returns an identifier that can be used to identify a particular minor version of RS.
Return | |
---|---|
Long |
The minor RenderScript version number |
releaseAllContexts
open static funreleaseAllContexts(): Unit
Deprecated: Deprecated in Java.
Releases all the process contexts. This is the same as calling .destroy() on each unique context retreived with create(...). If no contexts have been created this function does nothing. Typically you call this when your application is losing focus and will not be using a context for some time. This has no effect on a context created with createMultiContext()
sendMessage
open funsendMessage(
id: Int,
data: IntArray!
): Unit
Deprecated: Deprecated in Java.
Place a message into the message queue to be sent back to the message handler once all previous commands have been executed.
Parameters | |
---|---|
id |
Int: |
data |
IntArray!: |
setErrorHandler
open funsetErrorHandler(msg: RenderScript.RSErrorHandler!): Unit
Deprecated: Deprecated in Java.
setMessageHandler
open funsetMessageHandler(msg: RenderScript.RSMessageHandler!): Unit
Deprecated: Deprecated in Java.
setPriority
open funsetPriority(p: RenderScript.Priority!): Unit
Deprecated: Deprecated in Java.
Change the priority of the worker threads for this context.
Parameters | |
---|---|
p |
RenderScript.Priority!: New priority to be set. |
Protected methods
finalize
protected open funfinalize(): Unit
Deprecated: Deprecated in Java.
Exceptions | |
---|---|
java.lang.Throwable |
the Exception raised by this method |