FileDocCategorySizeDatePackage
UT_struct.javaAPI DocAndroid 5.1 API1655Thu Mar 12 22:22:54 GMT 2015com.android.rs.test

UT_struct

public class UT_struct extends UnitTest

Fields Summary
private android.content.res.Resources
mRes
Constructors Summary
protected UT_struct(RSTestCore rstc, android.content.res.Resources res, android.content.Context ctx)

        super(rstc, "Struct", ctx);
        mRes = res;
    
Methods Summary
public voidrun()

        RenderScript pRS = RenderScript.create(mCtx);
        ScriptC_struct s = new ScriptC_struct(pRS);
        pRS.setMessageHandler(mRsMessage);

        ScriptField_Point2 p = new ScriptField_Point2(pRS, 1);
        ScriptField_Point2.Item i = new ScriptField_Point2.Item();
        int val = 100;
        i.x = val;
        i.y = val;
        p.set(i, 0, true);
        s.bind_point2(p);
        s.invoke_struct_test(val);
        pRS.finish();
        waitForMessage();

        val = 200;
        p.set_x(0, val, true);
        p.set_y(0, val, true);
        s.invoke_struct_test(val);
        pRS.finish();
        waitForMessage();
        pRS.destroy();