FileDocCategorySizeDatePackage
RsBenchView.javaAPI DocAndroid 5.1 API3026Thu Mar 12 22:22:44 GMT 2015com.android.perftest

RsBenchView

public class RsBenchView extends android.renderscript.RSSurfaceView

Fields Summary
private android.renderscript.RenderScriptGL
mRS
private RsBenchRS
mRender
private int
mLoops
Constructors Summary
public RsBenchView(android.content.Context context)

        super(context);
    
Methods Summary
java.lang.String[]getTestNames()

        return mRender.mTestNames;
    
protected voidonDetachedFromWindow()

        if (mRS != null) {
            mRS = null;
            destroyRenderScriptGL();
        }
    
voidsetBenchmarkMode(int benchNum)

        mRender.setBenchmarkMode(benchNum);
    
voidsetDebugMode(int num)

        mRender.setDebugMode(num);
    
public voidsetLoops(int iterations)
Set the total number of loops the benchmark tests will run before the test results are collected.

        if (iterations > 0) {
            mLoops = iterations;
        }
    
public voidsurfaceChanged(android.view.SurfaceHolder holder, int format, int w, int h)


              
        super.surfaceChanged(holder, format, w, h);
        if (mRS == null) {
            RenderScriptGL.SurfaceConfig sc = new RenderScriptGL.SurfaceConfig();
            sc.setDepth(16, 24);
            mRS = createRenderScriptGL(sc);
            mRS.setSurface(holder, w, h);
            mRender = new RsBenchRS();
            Log.v("RsBenchView", "mLoops = " + mLoops);
            mRender.init(mRS, getResources(), w, h, mLoops);
        }
    
voidsuspendRendering(boolean pause)

        mRender.pause(pause);
    
public booleantestIsFinished()
Wait for message from the script

        return mRender.testIsFinished();