Loading tests/RenderScriptTests/PerfTest/src/com/android/perftest/FillTest.java +3 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,9 @@ public class FillTest implements RsBenchBaseTest{ mTests[index].testName = Allocation.createFromString(mRS, mNames[index], Allocation.USAGE_SCRIPT); mTests[index].debugName = RsBenchRS.createZeroTerminatedAlloc(mRS, mNames[index], Allocation.USAGE_SCRIPT); ScriptField_FillTestData_s.Item dataItem = new ScriptField_FillTestData_s.Item(); dataItem.testId = testId; Loading tests/RenderScriptTests/PerfTest/src/com/android/perftest/MeshTest.java +3 −0 Original line number Diff line number Diff line Loading @@ -69,6 +69,9 @@ public class MeshTest implements RsBenchBaseTest{ mTests[index].testName = Allocation.createFromString(mRS, mNames[index], Allocation.USAGE_SCRIPT); mTests[index].debugName = RsBenchRS.createZeroTerminatedAlloc(mRS, mNames[index], Allocation.USAGE_SCRIPT); ScriptField_MeshTestData_s.Item dataItem = new ScriptField_MeshTestData_s.Item(); dataItem.meshNum = meshNum; Loading tests/RenderScriptTests/PerfTest/src/com/android/perftest/RsBenchRS.java +21 −9 Original line number Diff line number Diff line Loading @@ -60,7 +60,6 @@ public class RsBenchRS { mWidth = width; mHeight = height; mMode = 0; mMaxModes = 0; mLoops = loops; mCurrentLoop = 0; mBenchmarkDimX = 1280; Loading Loading @@ -88,11 +87,30 @@ public class RsBenchRS { ScriptField_TestScripts_s.Item[] mIndividualTests; int mMode; int mMaxModes; String[] mTestNames; float[] mLocalTestResults; static Allocation createZeroTerminatedAlloc(RenderScript rs, String str, int usage) { byte[] allocArray = null; try { allocArray = str.getBytes("UTF-8"); byte[] allocArrayZero = new byte[allocArray.length + 1]; System.arraycopy(allocArray, 0, allocArrayZero, 0, allocArray.length); allocArrayZero[allocArrayZero.length - 1] = '\0'; Allocation alloc = Allocation.createSized(rs, Element.U8(rs), allocArrayZero.length, usage); alloc.copyFrom(allocArrayZero); return alloc; } catch (Exception e) { throw new RSRuntimeException("Could not convert string to utf-8."); } } void appendTests(RsBenchBaseTest testSet) { ScriptField_TestScripts_s.Item[] newTests = testSet.getTests(); if (mIndividualTests != null) { Loading @@ -119,6 +137,7 @@ public class RsBenchRS { void createTestAllocation() { int numTests = mIndividualTests.length; mLocalTestResults = new float[numTests]; ScriptField_TestScripts_s allTests; allTests = new ScriptField_TestScripts_s(mRS, numTests); for (int i = 0; i < numTests; i ++) { Loading Loading @@ -239,11 +258,6 @@ public class RsBenchRS { return count; } private void prepareTestData() { mTestNames = new String[mMaxModes]; mLocalTestResults = new float[mMaxModes]; } public void setDebugMode(int num) { mScript.invoke_setDebugMode(num); } Loading @@ -261,8 +275,6 @@ public class RsBenchRS { mScript.set_gMaxLoops(mLoops); prepareTestData(); initProgramVertex(); initProgramFragment(); mScript.set_gFontSerif(Font.create(mRS, mRes, "serif", Font.Style.NORMAL, 8)); Loading tests/RenderScriptTests/PerfTest/src/com/android/perftest/TextTest.java +3 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,9 @@ public class TextTest implements RsBenchBaseTest{ 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; Loading tests/RenderScriptTests/PerfTest/src/com/android/perftest/TorusTest.java +3 −0 Original line number Diff line number Diff line Loading @@ -98,6 +98,9 @@ public class TorusTest implements RsBenchBaseTest{ mTests[index].testName = Allocation.createFromString(mRS, mNames[index], Allocation.USAGE_SCRIPT); mTests[index].debugName = RsBenchRS.createZeroTerminatedAlloc(mRS, mNames[index], Allocation.USAGE_SCRIPT); ScriptField_TorusTestData_s.Item dataItem = new ScriptField_TorusTestData_s.Item(); dataItem.testId = testId; Loading Loading
tests/RenderScriptTests/PerfTest/src/com/android/perftest/FillTest.java +3 −0 Original line number Diff line number Diff line Loading @@ -62,6 +62,9 @@ public class FillTest implements RsBenchBaseTest{ mTests[index].testName = Allocation.createFromString(mRS, mNames[index], Allocation.USAGE_SCRIPT); mTests[index].debugName = RsBenchRS.createZeroTerminatedAlloc(mRS, mNames[index], Allocation.USAGE_SCRIPT); ScriptField_FillTestData_s.Item dataItem = new ScriptField_FillTestData_s.Item(); dataItem.testId = testId; Loading
tests/RenderScriptTests/PerfTest/src/com/android/perftest/MeshTest.java +3 −0 Original line number Diff line number Diff line Loading @@ -69,6 +69,9 @@ public class MeshTest implements RsBenchBaseTest{ mTests[index].testName = Allocation.createFromString(mRS, mNames[index], Allocation.USAGE_SCRIPT); mTests[index].debugName = RsBenchRS.createZeroTerminatedAlloc(mRS, mNames[index], Allocation.USAGE_SCRIPT); ScriptField_MeshTestData_s.Item dataItem = new ScriptField_MeshTestData_s.Item(); dataItem.meshNum = meshNum; Loading
tests/RenderScriptTests/PerfTest/src/com/android/perftest/RsBenchRS.java +21 −9 Original line number Diff line number Diff line Loading @@ -60,7 +60,6 @@ public class RsBenchRS { mWidth = width; mHeight = height; mMode = 0; mMaxModes = 0; mLoops = loops; mCurrentLoop = 0; mBenchmarkDimX = 1280; Loading Loading @@ -88,11 +87,30 @@ public class RsBenchRS { ScriptField_TestScripts_s.Item[] mIndividualTests; int mMode; int mMaxModes; String[] mTestNames; float[] mLocalTestResults; static Allocation createZeroTerminatedAlloc(RenderScript rs, String str, int usage) { byte[] allocArray = null; try { allocArray = str.getBytes("UTF-8"); byte[] allocArrayZero = new byte[allocArray.length + 1]; System.arraycopy(allocArray, 0, allocArrayZero, 0, allocArray.length); allocArrayZero[allocArrayZero.length - 1] = '\0'; Allocation alloc = Allocation.createSized(rs, Element.U8(rs), allocArrayZero.length, usage); alloc.copyFrom(allocArrayZero); return alloc; } catch (Exception e) { throw new RSRuntimeException("Could not convert string to utf-8."); } } void appendTests(RsBenchBaseTest testSet) { ScriptField_TestScripts_s.Item[] newTests = testSet.getTests(); if (mIndividualTests != null) { Loading @@ -119,6 +137,7 @@ public class RsBenchRS { void createTestAllocation() { int numTests = mIndividualTests.length; mLocalTestResults = new float[numTests]; ScriptField_TestScripts_s allTests; allTests = new ScriptField_TestScripts_s(mRS, numTests); for (int i = 0; i < numTests; i ++) { Loading Loading @@ -239,11 +258,6 @@ public class RsBenchRS { return count; } private void prepareTestData() { mTestNames = new String[mMaxModes]; mLocalTestResults = new float[mMaxModes]; } public void setDebugMode(int num) { mScript.invoke_setDebugMode(num); } Loading @@ -261,8 +275,6 @@ public class RsBenchRS { mScript.set_gMaxLoops(mLoops); prepareTestData(); initProgramVertex(); initProgramFragment(); mScript.set_gFontSerif(Font.create(mRS, mRes, "serif", Font.Style.NORMAL, 8)); Loading
tests/RenderScriptTests/PerfTest/src/com/android/perftest/TextTest.java +3 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,9 @@ public class TextTest implements RsBenchBaseTest{ 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; Loading
tests/RenderScriptTests/PerfTest/src/com/android/perftest/TorusTest.java +3 −0 Original line number Diff line number Diff line Loading @@ -98,6 +98,9 @@ public class TorusTest implements RsBenchBaseTest{ mTests[index].testName = Allocation.createFromString(mRS, mNames[index], Allocation.USAGE_SCRIPT); mTests[index].debugName = RsBenchRS.createZeroTerminatedAlloc(mRS, mNames[index], Allocation.USAGE_SCRIPT); ScriptField_TorusTestData_s.Item dataItem = new ScriptField_TorusTestData_s.Item(); dataItem.testId = testId; Loading