FileDocCategorySizeDatePackage
TextTest.javaAPI DocAndroid 5.1 API3233Thu Mar 12 22:22:44 GMT 2015com.android.perftest

TextTest

public class TextTest extends Object implements RsBenchBaseTest

Fields Summary
private static final String
TAG
private RenderScriptGL
mRS
private android.content.res.Resources
mRes
private ScriptC_text_test
mTextScript
ScriptField_TestScripts_s.Item[]
mTests
private final String[]
mNames
Constructors Summary
public TextTest()


      
    
Methods Summary
voidaddTest(int index, int fillNum)

        mTests[index] = new ScriptField_TestScripts_s.Item();
        mTests[index].testScript = mTextScript;
        mTests[index].testName = Allocation.createFromString(mRS,
                                                             mNames[index],
                                                             Allocation.USAGE_SCRIPT);
        mTests[index].debugName = RsBenchRS.createZeroTerminatedAlloc(mRS,
                                                                     mNames[index],
                                                                     Allocation.USAGE_SCRIPT);

        ScriptField_TextTestData_s.Item dataItem = new ScriptField_TextTestData_s.Item();
        dataItem.fillNum = fillNum;
        ScriptField_TextTestData_s testData = new ScriptField_TextTestData_s(mRS, 1);
        testData.set(dataItem, 0, true);
        mTests[index].testData = testData.getAllocation();
    
public java.lang.String[]getTestNames()

        return mNames;
    
public ScriptField_TestScripts_s.Item[]getTests()

        return mTests;
    
public booleaninit(RenderScriptGL rs, android.content.res.Resources res)

        mRS = rs;
        mRes = res;
        initTextScript();
        mTests = new ScriptField_TestScripts_s.Item[mNames.length];

        int index = 0;
        addTest(index++, 1 /*fillNum*/);
        addTest(index++, 3 /*fillNum*/);
        addTest(index++, 5 /*fillNum*/);

        return true;
    
voidinitTextScript()

        DisplayMetrics metrics = mRes.getDisplayMetrics();

        mTextScript = new ScriptC_text_test(mRS, mRes, R.raw.text_test);
        mTextScript.set_gFontSans(Font.create(mRS, mRes, "sans-serif",
                                              Font.Style.NORMAL, 8.0f / metrics.density));
        mTextScript.set_gFontSerif(Font.create(mRS, mRes, "serif",
                                               Font.Style.NORMAL, 8.0f / metrics.density));