Code example for Allocation

Methods: ioSendOutput, setSurfaceTexture

0
        b.recycle();
        return b2;
    } 
 
    private void filter() { 
        mScript.forEach_root(mInPixelsAllocation, mOutPixelsAllocation);
        mOutPixelsAllocation.ioSendOutput();
        mRS.finish();
    } 
 
    public void benchmark(View v) {
        filter(); 
        long t = java.lang.System.currentTimeMillis();
        filter(); 
        t = java.lang.System.currentTimeMillis() - t;
        mDisplayView.invalidate();
        mBenchmarkResult.setText("Result: " + t + " ms");
    } 
 
 
    @Override 
    public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) {
        mOutPixelsAllocation.setSurfaceTexture(surface);
        filter(); 
    } 
 
    @Override 
    public void onSurfaceTextureSizeChanged(SurfaceTexture surface, int width, int height) {