FileDocCategorySizeDatePackage
RSSurfaceView.javaAPI DocAndroid 5.1 API4957Thu Mar 12 22:22:42 GMT 2015android.renderscript

RSSurfaceView

public class RSSurfaceView extends android.view.SurfaceView implements SurfaceHolder.Callback
hide
deprecated
in API 16 The Surface View for a graphics renderscript (RenderScriptGL) to draw on.

Developer Guides

For more information about creating an application that uses RenderScript, read the RenderScript developer guide.

Fields Summary
private android.view.SurfaceHolder
mSurfaceHolder
private RenderScriptGL
mRS
Constructors Summary
public RSSurfaceView(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 RSSurfaceView(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

      RenderScriptGL rs = new RenderScriptGL(this.getContext(), sc);
        setRenderScriptGL(rs);
        return rs;
    
public voiddestroyRenderScriptGL()

deprecated
in API 16

        synchronized (this) {
            mRS.destroy();
            mRS = null;
        }
    
public RenderScriptGLgetRenderScriptGL()

deprecated
in API 16

        return mRS;
    
private voidinit()

        // Install a SurfaceHolder.Callback so we get notified when the
        // underlying surface is created and destroyed
        SurfaceHolder holder = getHolder();
        holder.addCallback(this);
    
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

        mRS = rs;
    
public voidsurfaceChanged(android.view.SurfaceHolder holder, int format, int w, int h)

deprecated
in API 16 This method is part of the SurfaceHolder.Callback interface, and is not normally called or subclassed by clients of RSSurfaceView.

        synchronized (this) {
            if (mRS != null) {
                mRS.setSurface(holder, w, h);
            }
        }
    
public voidsurfaceCreated(android.view.SurfaceHolder holder)

deprecated
in API 16 This method is part of the SurfaceHolder.Callback interface, and is not normally called or subclassed by clients of RSSurfaceView.

        mSurfaceHolder = holder;
    
public voidsurfaceDestroyed(android.view.SurfaceHolder holder)

deprecated
in API 16 This method is part of the SurfaceHolder.Callback interface, and is not normally called or subclassed by clients of RSSurfaceView.

        synchronized (this) {
            // Surface will be destroyed when we return
            if (mRS != null) {
                mRS.setSurface(null, 0, 0);
            }
        }