FileDocCategorySizeDatePackage
UT_apitest.javaAPI DocAndroid 5.1 API2010Thu Mar 12 22:22:54 GMT 2015com.android.rs.test_compat

UT_apitest

public class UT_apitest extends UnitTest

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

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

        RenderScript pRS = RenderScript.create(mCtx);
        ScriptC_apitest s = new ScriptC_apitest(pRS);
        pRS.setMessageHandler(mRsMessage);
        Element elem = Element.I8(pRS);
        Type.Builder typeBuilder = new Type.Builder(pRS, elem);

        int x = 5;
        int y = 7;
        int z = 0;  // Don't actually setZ()
        s.set_x(x);
        s.set_y(y);
        s.set_z(z);
        typeBuilder.setX(x).setY(y);
        Type type = typeBuilder.create();
        Allocation alloc = Allocation.createTyped(pRS, type);
        Allocation allocDst = Allocation.createTyped(pRS, type);
        Sampler sampler = Sampler.CLAMP_NEAREST(pRS);
        s.set_elemNonNull(elem);
        s.set_typeNonNull(type);
        s.set_allocNonNull(alloc);
        s.set_allocDst(allocDst);
        s.set_samplerNonNull(sampler);
        s.set_scriptNonNull(s);
        s.bind_allocPtr(alloc);

        s.invoke_api_test();
        pRS.finish();
        waitForMessage();
        pRS.destroy();