FileDocCategorySizeDatePackage
RSTextureView.javaAPI DocAndroid 5.1 API5583Thu Mar 12 22:22:42 GMT 2015android.renderscript

RSTextureView

public class RSTextureView extends android.view.TextureView implements TextureView.SurfaceTextureListener
hide
deprecated
in API 16 The Texture View for a graphics renderscript (RenderScriptGL) to draw on.

Fields Summary
private RenderScriptGL
mRS
private android.graphics.SurfaceTexture
mSurfaceTexture
Constructors Summary
public RSTextureView(android.content.Context context)

deprecated
in API 16 Standard View constructor. In order to render something, you must call {@link android.opengl.GLSurfaceView#setRenderer} to register a renderer.

        super(context);
        init();
        //Log.v(RenderScript.LOG_TAG, "RSSurfaceView");
    
public RSTextureView(android.content.Context context, android.util.AttributeSet attrs)

deprecated
in API 16 Standard View constructor. In order to render something, you must call {@link android.opengl.GLSurfaceView#setRenderer} to register a renderer.

        super(context, attrs);
        init();
        //Log.v(RenderScript.LOG_TAG, "RSSurfaceView");
    
Methods Summary
public RenderScriptGLcreateRenderScriptGL(RenderScriptGL.SurfaceConfig sc)

deprecated
in API 16 Create a new RenderScriptGL object and attach it to the TextureView if present.
param
sc The RS surface config to create.
return
RenderScriptGL The new object created.

        RenderScriptGL rs = new RenderScriptGL(this.getContext(), sc);
        setRenderScriptGL(rs);
        if (mSurfaceTexture != null) {
            mRS.setSurfaceTexture(mSurfaceTexture, getWidth(), getHeight());
        }
        return rs;
    
public voiddestroyRenderScriptGL()

deprecated
in API 16 Destroy the RenderScriptGL object associated with this TextureView.

        mRS.destroy();
        mRS = null;
    
public RenderScriptGLgetRenderScriptGL()

deprecated
in API 16 Returns the previously set RenderScriptGL object.
return
RenderScriptGL

        return mRS;
    
private voidinit()

        setSurfaceTextureListener(this);
        //android.util.Log.e("rs", "getSurfaceTextureListerner " + getSurfaceTextureListener());
    
public voidonSurfaceTextureAvailable(android.graphics.SurfaceTexture surface, int width, int height)

deprecated
in API 16

        //Log.e(RenderScript.LOG_TAG, "onSurfaceTextureAvailable");
        mSurfaceTexture = surface;

        if (mRS != null) {
            mRS.setSurfaceTexture(mSurfaceTexture, width, height);
        }
    
public booleanonSurfaceTextureDestroyed(android.graphics.SurfaceTexture surface)

deprecated
in API 16

        //Log.e(RenderScript.LOG_TAG, "onSurfaceTextureDestroyed");
        mSurfaceTexture = surface;

        if (mRS != null) {
            mRS.setSurfaceTexture(null, 0, 0);
        }

        return true;
    
public voidonSurfaceTextureSizeChanged(android.graphics.SurfaceTexture surface, int width, int height)

deprecated
in API 16

        //Log.e(RenderScript.LOG_TAG, "onSurfaceTextureSizeChanged");
        mSurfaceTexture = surface;

        if (mRS != null) {
            mRS.setSurfaceTexture(mSurfaceTexture, width, height);
        }
    
public voidonSurfaceTextureUpdated(android.graphics.SurfaceTexture surface)

deprecated
in API 16

        //Log.e(RenderScript.LOG_TAG, "onSurfaceTextureUpdated");
        mSurfaceTexture = surface;
    
public voidpause()

deprecated
in API 16 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.

        if(mRS != null) {
            mRS.pause();
        }
    
public voidresume()

deprecated
in API 16 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.

        if(mRS != null) {
            mRS.resume();
        }
    
public voidsetRenderScriptGL(RenderScriptGL rs)

deprecated
in API 16 Set a new RenderScriptGL object. This also will attach the new object to the TextureView if present.
param
rs The new RS object.

        mRS = rs;
        if (mSurfaceTexture != null) {
            mRS.setSurfaceTexture(mSurfaceTexture, getWidth(), getHeight());
        }