FileDocCategorySizeDatePackage
TestLatencyView.javaAPI DocAndroid 5.1 API9918Thu Mar 12 22:22:48 GMT 2015com.android.testlatency

TestLatencyView

public class TestLatencyView extends android.opengl.GLSurfaceView
An implementation of SurfaceView that uses the dedicated surface for displaying an OpenGL animation. This allows the animation to run in a separate thread, without requiring that it be driven by the update mechanism of the view hierarchy. The application-specific rendering code is delegated to a GLView.Renderer instance.

Fields Summary
private static String
TAG
private float
mX
private float
mY
private float
mDX
private float
mDY
private long
mT
private long
mDT
Constructors Summary
public TestLatencyView(android.content.Context context)


       
        super(context);
        setEGLContextClientVersion(2);
        setRenderer(new Renderer());
    
Methods Summary
public booleanonTouchEvent(android.view.MotionEvent event)

        switch (event.getAction()) {
        case MotionEvent.ACTION_MOVE:
            float x = event.getX();
            float y = event.getY();
            long  t = event.getEventTime();
            synchronized(this) {
                mDT = t - mT;
                mT = t;
                mDX = x - mX;
                mX = x;
                mDY = y - mY;
                mY = y;
            }
            break;
        default:
            break;
        }
        return true;