FileDocCategorySizeDatePackage
RsRenderStatesView.javaAPI DocAndroid 5.1 API2188Thu Mar 12 22:22:44 GMT 2015com.example.android.rs.miscsamples

RsRenderStatesView

public class RsRenderStatesView extends android.renderscript.RSSurfaceView

Fields Summary
private android.renderscript.RenderScriptGL
mRS
private RsRenderStatesRS
mRender
Constructors Summary
public RsRenderStatesView(android.content.Context context)

        super(context);
        ensureRenderScript();
    
Methods Summary
private voidensureRenderScript()

        if (mRS == null) {
            RenderScriptGL.SurfaceConfig sc = new RenderScriptGL.SurfaceConfig();
            sc.setDepth(16, 24);
            mRS = createRenderScriptGL(sc);
            mRender = new RsRenderStatesRS();
            mRender.init(mRS, getResources());
        }
    
protected voidonAttachedToWindow()

        super.onAttachedToWindow();
        ensureRenderScript();
    
protected voidonDetachedFromWindow()

        mRender = null;
        if (mRS != null) {
            mRS = null;
            destroyRenderScriptGL();
        }
    
public booleanonTouchEvent(android.view.MotionEvent ev)

        if (ev.getAction() == MotionEvent.ACTION_DOWN) {
            mRender.onActionDown((int)ev.getX(), (int)ev.getY());
            return true;
        }

        return false;
    
public voidsurfaceChanged(android.view.SurfaceHolder holder, int format, int w, int h)

        super.surfaceChanged(holder, format, w, h);
        mRender.surfaceChanged();