RenderScript Graphics Functions and Types

Overview

The graphics subsystem of RenderScript was removed at API level 23.

Summary

Deprecated Types
rs_blend_dst_func Deprecated. Blend destination function
rs_blend_src_func Deprecated. Blend source function
rs_cull_mode Deprecated. Culling mode
rs_depth_func Deprecated. Depth function
rs_font Deprecated. Handle to a Font
rs_mesh Deprecated. Handle to a Mesh
rs_primitive Deprecated. How to interpret mesh vertex data
rs_program_fragment Deprecated. Handle to a ProgramFragment
rs_program_raster Deprecated. Handle to a ProgramRaster
rs_program_store Deprecated. Handle to a ProgramStore
rs_program_vertex Deprecated. Handle to a ProgramVertex
Deprecated Functions
rsgAllocationSyncAll Deprecated. Sync the contents of an allocation
rsgBindColorTarget Deprecated. Set the color target
rsgBindConstant Deprecated. Bind a constant allocation
rsgBindDepthTarget Deprecated. Set the depth target
rsgBindFont Deprecated. Bind a font object
rsgBindProgramFragment Deprecated. Bind a ProgramFragment
rsgBindProgramRaster Deprecated. Bind a ProgramRaster
rsgBindProgramStore Deprecated. Bind a ProgramStore
rsgBindProgramVertex Deprecated. Bind a ProgramVertex
rsgBindSampler Deprecated. Bind a sampler
rsgBindTexture Deprecated. Bind a texture allocation
rsgClearAllRenderTargets Deprecated. Clear all color and depth targets
rsgClearColor Deprecated. Clear the specified color from the surface
rsgClearColorTarget Deprecated. Clear the color target
rsgClearDepth Deprecated. Clear the depth surface
rsgClearDepthTarget Deprecated. Clear the depth target
rsgDrawMesh Deprecated. Draw a mesh
rsgDrawQuad Deprecated. Draw a quad
rsgDrawQuadTexCoords Deprecated. Draw a textured quad
rsgDrawRect Deprecated. Draw a rectangle
rsgDrawSpriteScreenspace Deprecated. Draw rectangles in screenspace
rsgDrawText Deprecated. Draw a text string
rsgFinish Deprecated. End rendering commands
rsgFontColor Deprecated. Set the font color
rsgGetHeight Deprecated. Get the surface height
rsgGetWidth Deprecated. Get the surface width
rsgMeasureText Deprecated. Get the bounding box for a text string
rsgMeshComputeBoundingBox Deprecated. Compute a bounding box
rsgMeshGetIndexAllocation Deprecated. Return an allocation containing index data
rsgMeshGetPrimitive Deprecated. Return the primitive
rsgMeshGetPrimitiveCount Deprecated. Return the number of index sets
rsgMeshGetVertexAllocation Deprecated. Return a vertex allocation
rsgMeshGetVertexAllocationCount Deprecated. Return the number of vertex allocations
rsgProgramFragmentConstantColor Deprecated. Set the constant color for a fixed function emulation program
rsgProgramRasterGetCullMode Deprecated. Get program raster cull mode
rsgProgramRasterIsPointSpriteEnabled Deprecated. Get program raster point sprite state
rsgProgramStoreGetBlendDstFunc Deprecated. Get program store blend destination function
rsgProgramStoreGetBlendSrcFunc Deprecated. Get program store blend source function
rsgProgramStoreGetDepthFunc Deprecated. Get program store depth function
rsgProgramStoreIsColorMaskAlphaEnabled Deprecated. Get program store alpha component color mask
rsgProgramStoreIsColorMaskBlueEnabled Deprecated. Get program store blur component color mask
rsgProgramStoreIsColorMaskGreenEnabled Deprecated. Get program store green component color mask
rsgProgramStoreIsColorMaskRedEnabled Deprecated. Get program store red component color mask
rsgProgramStoreIsDepthMaskEnabled Deprecated. Get program store depth mask
rsgProgramStoreIsDitherEnabled Deprecated. Get program store dither state
rsgProgramVertexGetProjectionMatrix Deprecated. Get the projection matrix for a fixed function vertex program
rsgProgramVertexLoadModelMatrix Deprecated. Load the model matrix for a bound fixed function vertex program
rsgProgramVertexLoadProjectionMatrix Deprecated. Load the projection matrix for a bound fixed function vertex program
rsgProgramVertexLoadTextureMatrix Deprecated. Load the texture matrix for a bound fixed function vertex program

rs_blend_dst_func : Blend destination function

An enum with the following values:      When compiling for 32 bits. API level 16 - 22

RS_BLEND_DST_ZERO = 0
RS_BLEND_DST_ONE = 1
RS_BLEND_DST_SRC_COLOR = 2
RS_BLEND_DST_ONE_MINUS_SRC_COLOR = 3
RS_BLEND_DST_SRC_ALPHA = 4
RS_BLEND_DST_ONE_MINUS_SRC_ALPHA = 5
RS_BLEND_DST_DST_ALPHA = 6
RS_BLEND_DST_ONE_MINUS_DST_ALPHA = 7
RS_BLEND_DST_INVALID = 100

Deprecated. Do not use.

rs_blend_src_func : Blend source function

An enum with the following values:      When compiling for 32 bits. API level 16 - 22

RS_BLEND_SRC_ZERO = 0
RS_BLEND_SRC_ONE = 1
RS_BLEND_SRC_DST_COLOR = 2
RS_BLEND_SRC_ONE_MINUS_DST_COLOR = 3
RS_BLEND_SRC_SRC_ALPHA = 4
RS_BLEND_SRC_ONE_MINUS_SRC_ALPHA = 5
RS_BLEND_SRC_DST_ALPHA = 6
RS_BLEND_SRC_ONE_MINUS_DST_ALPHA = 7
RS_BLEND_SRC_SRC_ALPHA_SATURATE = 8
RS_BLEND_SRC_INVALID = 100

Deprecated. Do not use.

rs_cull_mode : Culling mode

An enum with the following values:      When compiling for 32 bits. API level 16 - 22

RS_CULL_BACK = 0
RS_CULL_FRONT = 1
RS_CULL_NONE = 2
RS_CULL_INVALID = 100

Deprecated. Do not use.

rs_depth_func : Depth function

An enum with the following values:      When compiling for 32 bits. API level 16 - 22

RS_DEPTH_FUNC_ALWAYS = 0Always drawn
RS_DEPTH_FUNC_LESS = 1Drawn if the incoming depth value is less than that in the depth buffer
RS_DEPTH_FUNC_LEQUAL = 2Drawn if the incoming depth value is less or equal to that in the depth buffer
RS_DEPTH_FUNC_GREATER = 3Drawn if the incoming depth value is greater than that in the depth buffer
RS_DEPTH_FUNC_GEQUAL = 4Drawn if the incoming depth value is greater or equal to that in the depth buffer
RS_DEPTH_FUNC_EQUAL = 5Drawn if the incoming depth value is equal to that in the depth buffer
RS_DEPTH_FUNC_NOTEQUAL = 6Drawn if the incoming depth value is not equal to that in the depth buffer
RS_DEPTH_FUNC_INVALID = 100Invalid depth function

Deprecated. Do not use.

Specifies conditional drawing depending on the comparison of the incoming depth to that found in the depth buffer.

rs_font : Handle to a Font

When compiling for 32 bits. Removed from API level 23 and higher

Deprecated. Do not use.

Opaque handle to a RenderScript font object. See: android.renderscript.Font

rs_mesh : Handle to a Mesh

When compiling for 32 bits. Removed from API level 23 and higher

Deprecated. Do not use.

Opaque handle to a RenderScript mesh object. See: android.renderscript.Mesh

rs_primitive : How to interpret mesh vertex data

An enum with the following values:      When compiling for 32 bits. API level 16 - 22

RS_PRIMITIVE_POINT = 0Vertex data will be rendered as a series of points
RS_PRIMITIVE_LINE = 1Vertex pairs will be rendered as lines
RS_PRIMITIVE_LINE_STRIP = 2Vertex data will be rendered as a connected line strip
RS_PRIMITIVE_TRIANGLE = 3Vertices will be rendered as individual triangles
RS_PRIMITIVE_TRIANGLE_STRIP = 4Vertices will be rendered as a connected triangle strip defined by the first three vertices with each additional triangle defined by a new vertex
RS_PRIMITIVE_TRIANGLE_FAN = 5Vertices will be rendered as a sequence of triangles that all share first vertex as the origin
RS_PRIMITIVE_INVALID = 100Invalid primitive

Deprecated. Do not use.

Describes the way mesh vertex data is interpreted when rendering

rs_program_fragment : Handle to a ProgramFragment

When compiling for 32 bits. Removed from API level 23 and higher

Deprecated. Do not use.

Opaque handle to a RenderScript ProgramFragment object. See: android.renderscript.ProgramFragment

rs_program_raster : Handle to a ProgramRaster

When compiling for 32 bits. Removed from API level 23 and higher

Deprecated. Do not use.

Opaque handle to a RenderScript ProgramRaster object. See: android.renderscript.ProgramRaster

rs_program_store : Handle to a ProgramStore

When compiling for 32 bits. Removed from API level 23 and higher

Deprecated. Do not use.

Opaque handle to a RenderScript ProgramStore object. See: android.renderscript.ProgramStore

rs_program_vertex : Handle to a ProgramVertex

When compiling for 32 bits. Removed from API level 23 and higher

Deprecated. Do not use.

Opaque handle to a RenderScript ProgramVertex object. See: android.renderscript.ProgramVertex

Functions

rsgAllocationSyncAll : Sync the contents of an allocation

Deprecated. Do not use.

Sync the contents of an allocation.

If the source is specified, sync from memory space specified by source.

If the source is not specified, sync from its SCRIPT memory space to its HW memory spaces.

rsgBindColorTarget : Set the color target

Deprecated. Do not use.

Set the color target used for all subsequent rendering calls

rsgBindConstant : Bind a constant allocation

Parameters
psprogram fragment object
slotindex of the constant buffer on the program
cconstants to bind
pvprogram vertex object

Deprecated. Do not use.

Bind a new Allocation object to a ProgramFragment or ProgramVertex. The Allocation must be a valid constant input for the Program.

rsgBindDepthTarget : Set the depth target

Deprecated. Do not use.

Set the depth target used for all subsequent rendering calls

rsgBindFont : Bind a font object

Parameters
fontobject to bind

Deprecated. Do not use.

Binds the font object to be used for all subsequent font rendering calls

rsgBindProgramFragment : Bind a ProgramFragment

Deprecated. Do not use.

Bind a new ProgramFragment to the rendering context.

rsgBindProgramRaster : Bind a ProgramRaster

Deprecated. Do not use.

Bind a new ProgramRaster to the rendering context.

rsgBindProgramStore : Bind a ProgramStore

Deprecated. Do not use.

Bind a new ProgramStore to the rendering context.

rsgBindProgramVertex : Bind a ProgramVertex

Deprecated. Do not use.

Bind a new ProgramVertex to the rendering context.

rsgBindSampler : Bind a sampler

Deprecated. Do not use.

Bind a new Sampler object to a ProgramFragment. The sampler will operate on the texture bound at the matching slot.

rsgBindTexture : Bind a texture allocation

Deprecated. Do not use.

Bind a new Allocation object to a ProgramFragment. The Allocation must be a valid texture for the Program. The sampling of the texture will be controlled by the Sampler bound at the matching slot.

rsgClearAllRenderTargets : Clear all color and depth targets

Deprecated. Do not use.

Clear all color and depth targets and resume rendering into the framebuffer

rsgClearColor : Clear the specified color from the surface

void rsgClearColor(float r, float g, float b, float a); When compiling for 32 bits. Removed from API level 23 and higher

Deprecated. Do not use.

Clears the rendering surface to the specified color.

rsgClearColorTarget : Clear the color target

Deprecated. Do not use.

Clear the previously set color target

rsgClearDepth : Clear the depth surface

Deprecated. Do not use.

Clears the depth suface to the specified value.

rsgClearDepthTarget : Clear the depth target

Deprecated. Do not use.

Clear the previously set depth target

rsgDrawMesh : Draw a mesh

Parameters
ismmesh object to render
primitiveIndexfor meshes that contain multiple primitive groups this parameter specifies the index of the group to draw.
startstarting index in the range
lennumber of indices to draw

Deprecated. Do not use.

Draw a mesh using the current context state.

If primitiveIndex is specified, draw part of a mesh using the current context state.

If start and len are also specified, draw specified index range of part of a mesh using the current context state.

Otherwise the whole mesh is rendered.

rsgDrawQuad : Draw a quad

void rsgDrawQuad(float x1, float y1, float z1, float x2, float y2, float z2, float x3, float y3, float z3, float x4, float y4, float z4); When compiling for 32 bits. Removed from API level 23 and higher

Deprecated. Do not use.

Low performance utility function for drawing a simple quad. Not intended for drawing large quantities of geometry.

rsgDrawQuadTexCoords : Draw a textured quad

void rsgDrawQuadTexCoords(float x1, float y1, float z1, float u1, float v1, float x2, float y2, float z2, float u2, float v2, float x3, float y3, float z3, float u3, float v3, float x4, float y4, float z4, float u4, float v4); When compiling for 32 bits. Removed from API level 23 and higher

Deprecated. Do not use.

Low performance utility function for drawing a textured quad. Not intended for drawing large quantities of geometry.

rsgDrawRect : Draw a rectangle

void rsgDrawRect(float x1, float y1, float x2, float y2, float z); When compiling for 32 bits. Removed from API level 23 and higher

Deprecated. Do not use.

Low performance utility function for drawing a simple rectangle. Not intended for drawing large quantities of geometry.

rsgDrawSpriteScreenspace : Draw rectangles in screenspace

void rsgDrawSpriteScreenspace(float x, float y, float z, float w, float h); When compiling for 32 bits. Removed from API level 23 and higher

Deprecated. Do not use.

Low performance function for drawing rectangles in screenspace. This function uses the default passthough ProgramVertex. Any bound ProgramVertex is ignored. This function has considerable overhead and should not be used for drawing in shipping applications.

rsgDrawText : Draw a text string

Deprecated. Do not use.

Draws text given a string and location

rsgFinish : End rendering commands

Deprecated. Do not use.

Force RenderScript to finish all rendering commands

rsgFontColor : Set the font color

void rsgFontColor(float r, float g, float b, float a); When compiling for 32 bits. Removed from API level 23 and higher
Parameters
rred component
ggreen component
bblue component
aalpha component

Deprecated. Do not use.

Sets the font color for all subsequent rendering calls

rsgGetHeight : Get the surface height

Deprecated. Do not use.

Get the height of the current rendering surface.

rsgGetWidth : Get the surface width

Deprecated. Do not use.

Get the width of the current rendering surface.

rsgMeasureText : Get the bounding box for a text string

void rsgMeasureText(const char* text, int* left, int* right, int* top, int* bottom); When compiling for 32 bits. Removed from API level 23 and higher
void rsgMeasureText(rs_allocation alloc, int* left, int* right, int* top, int* bottom); When compiling for 32 bits. Removed from API level 23 and higher

Deprecated. Do not use.

Returns the bounding box of the text relative to (0, 0) Any of left, right, top, bottom could be NULL

rsgMeshComputeBoundingBox : Compute a bounding box

Deprecated. Do not use.

Computes an axis aligned bounding box of a mesh object

rsgMeshGetIndexAllocation : Return an allocation containing index data

Parameters
mmesh to get data from
indexindex of the index allocation
Returns

allocation containing index data

Deprecated. Do not use.

Returns an allocation containing index data or a null allocation if only the primitive is specified

rsgMeshGetPrimitive : Return the primitive

Parameters
mmesh to get data from
indexindex of the primitive
Returns

primitive describing how the mesh is rendered

Deprecated. Do not use.

Returns the primitive describing how a part of the mesh is rendered

rsgMeshGetPrimitiveCount : Return the number of index sets

Parameters
mmesh to get data from
Returns

number of primitive groups in the mesh. This would include simple primitives as well as allocations containing index data

Deprecated. Do not use.

Meshes could have multiple index sets, this function returns the number.

rsgMeshGetVertexAllocation : Return a vertex allocation

Parameters
mmesh to get data from
indexindex of the vertex allocation
Returns

allocation containing vertex data

Deprecated. Do not use.

Returns an allocation that is part of the mesh and contains vertex data, e.g. positions, normals, texcoords

rsgMeshGetVertexAllocationCount : Return the number of vertex allocations

Parameters
mmesh to get data from
Returns

number of allocations in the mesh that contain vertex data

Deprecated. Do not use.

Returns the number of allocations in the mesh that contain vertex data

rsgProgramFragmentConstantColor : Set the constant color for a fixed function emulation program

Deprecated. Do not use.

Set the constant color for a fixed function emulation program.

rsgProgramRasterGetCullMode : Get program raster cull mode

Parameters
prprogram raster to query

Deprecated. Do not use.

Get program raster cull mode

rsgProgramRasterIsPointSpriteEnabled : Get program raster point sprite state

Parameters
prprogram raster to query

Deprecated. Do not use.

Get program raster point sprite state

rsgProgramStoreGetBlendDstFunc : Get program store blend destination function

Parameters
psprogram store to query

Deprecated. Do not use.

Get program store blend destination function

rsgProgramStoreGetBlendSrcFunc : Get program store blend source function

Parameters
psprogram store to query

Deprecated. Do not use.

Get program store blend source function

rsgProgramStoreGetDepthFunc : Get program store depth function

Parameters
psprogram store to query

Deprecated. Do not use.

Get program store depth function

rsgProgramStoreIsColorMaskAlphaEnabled : Get program store alpha component color mask

Parameters
psprogram store to query

Deprecated. Do not use.

Get program store alpha component color mask

rsgProgramStoreIsColorMaskBlueEnabled : Get program store blur component color mask

Parameters
psprogram store to query

Deprecated. Do not use.

Get program store blur component color mask

rsgProgramStoreIsColorMaskGreenEnabled : Get program store green component color mask

Parameters
psprogram store to query

Deprecated. Do not use.

Get program store green component color mask

rsgProgramStoreIsColorMaskRedEnabled : Get program store red component color mask

Parameters
psprogram store to query

Deprecated. Do not use.

Get program store red component color mask

rsgProgramStoreIsDepthMaskEnabled : Get program store depth mask

Parameters
psprogram store to query

Deprecated. Do not use.

Get program store depth mask

rsgProgramStoreIsDitherEnabled : Get program store dither state

Parameters
psprogram store to query

Deprecated. Do not use.

Get program store dither state

rsgProgramVertexGetProjectionMatrix : Get the projection matrix for a fixed function vertex program

Parameters
projmatrix to store the current projection matrix into

Deprecated. Do not use.

Get the projection matrix for a currently bound fixed function vertex program. Calling this function with a custom vertex shader would result in an error.

rsgProgramVertexLoadModelMatrix : Load the model matrix for a bound fixed function vertex program

Parameters
modelmodel matrix

Deprecated. Do not use.

Load the model matrix for a currently bound fixed function vertex program. Calling this function with a custom vertex shader would result in an error.

rsgProgramVertexLoadProjectionMatrix : Load the projection matrix for a bound fixed function vertex program

Parameters
projprojection matrix

Deprecated. Do not use.

Load the projection matrix for a currently bound fixed function vertex program. Calling this function with a custom vertex shader would result in an error.

rsgProgramVertexLoadTextureMatrix : Load the texture matrix for a bound fixed function vertex program

Parameters
textexture matrix

Deprecated. Do not use.

Load the texture matrix for a currently bound fixed function vertex program. Calling this function with a custom vertex shader would result in an error.

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2025-02-10 UTC.