public class

RSTextureView

extends TextureView
implements TextureView.SurfaceTextureListener
java.lang.Object
   ↳ android.view.View
     ↳ android.view.TextureView
       ↳ android.renderscript.RSTextureView

Class Overview

The Texture View for a graphics renderscript (RenderScriptGL) to draw on.

Summary

[Expand]
Inherited XML Attributes
From class android.view.View
[Expand]
Inherited Constants
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
RSTextureView(Context context)
Standard View constructor.
RSTextureView(Context context, AttributeSet attrs)
Standard View constructor.
Public Methods
RenderScriptGL createRenderScriptGL(RenderScriptGL.SurfaceConfig sc)
Create a new RenderScriptGL object and attach it to the TextureView if present.
void destroyRenderScriptGL()
Destroy the RenderScriptGL object associated with this TextureView.
RenderScriptGL getRenderScriptGL()
Returns the previously set RenderScriptGL object.
void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height)
Invoked when a TextureView's SurfaceTexture is ready for use.
boolean onSurfaceTextureDestroyed(SurfaceTexture surface)
Invoked when the specified SurfaceTexture is about to be destroyed.
void onSurfaceTextureSizeChanged(SurfaceTexture surface, int width, int height)
Invoked when the SurfaceTexture's buffers size changed.
void onSurfaceTextureUpdated(SurfaceTexture surface)
Invoked when the specified SurfaceTexture is updated through updateTexImage().
void pause()
Inform the view that the activity is paused.
void resume()
Inform the view that the activity is resumed.
void setRenderScriptGL(RenderScriptGL rs)
Set a new RenderScriptGL object.
[Expand]
Inherited Methods
From class android.view.TextureView
From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.TextureView.SurfaceTextureListener
From interface android.view.accessibility.AccessibilityEventSource

Public Constructors

public RSTextureView (Context context)

Since: API Level 14

Standard View constructor. In order to render something, you must call setRenderer(GLSurfaceView.Renderer) to register a renderer.

public RSTextureView (Context context, AttributeSet attrs)

Since: API Level 14

Standard View constructor. In order to render something, you must call setRenderer(GLSurfaceView.Renderer) to register a renderer.

Public Methods

public RenderScriptGL createRenderScriptGL (RenderScriptGL.SurfaceConfig sc)

Since: API Level 14

Create a new RenderScriptGL object and attach it to the TextureView if present.

Parameters
sc The RS surface config to create.
Returns
  • RenderScriptGL The new object created.

public void destroyRenderScriptGL ()

Since: API Level 14

Destroy the RenderScriptGL object associated with this TextureView.

public RenderScriptGL getRenderScriptGL ()

Since: API Level 14

Returns the previously set RenderScriptGL object.

Returns
  • RenderScriptGL

public void onSurfaceTextureAvailable (SurfaceTexture surface, int width, int height)

Since: API Level 14

Invoked when a TextureView's SurfaceTexture is ready for use.

Parameters
surface The surface returned by getSurfaceTexture()
width The width of the surface
height The height of the surface

public boolean onSurfaceTextureDestroyed (SurfaceTexture surface)

Since: API Level 14

Invoked when the specified SurfaceTexture is about to be destroyed. If returns true, no rendering should happen inside the surface texture after this method is invoked. If returns false, the client needs to call release().

Parameters
surface The surface about to be destroyed

public void onSurfaceTextureSizeChanged (SurfaceTexture surface, int width, int height)

Since: API Level 14

Invoked when the SurfaceTexture's buffers size changed.

Parameters
surface The surface returned by getSurfaceTexture()
width The new width of the surface
height The new height of the surface

public void onSurfaceTextureUpdated (SurfaceTexture surface)

Since: API Level 14

Invoked when the specified SurfaceTexture is updated through updateTexImage().

Parameters
surface The surface just updated

public void pause ()

Since: API Level 14

Inform the view that the activity is paused. The owner of this view must call this method when the activity is paused. Calling this method will pause the rendering thread. Must not be called before a renderer has been set.

public void resume ()

Since: API Level 14

Inform the view that the activity is resumed. The owner of this view must call this method when the activity is resumed. Calling this method will recreate the OpenGL display and resume the rendering thread. Must not be called before a renderer has been set.

public void setRenderScriptGL (RenderScriptGL rs)

Since: API Level 14

Set a new RenderScriptGL object. This also will attach the new object to the TextureView if present.

Parameters
rs The new RS object.