summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian_Chu <walkingice@0xlab.org>2011-08-03 14:46:19 +0800
committerJulian_Chu <walkingice@0xlab.org>2011-08-03 16:34:23 +0800
commit1772a907e73e188317c60d5d9561551e5d9b6c5f (patch)
tree3492bdffdc9198e5f9e252c3a0f5f0bef03028e3
parenta7c0d4927b3d4ab47fd2833bcf14c2a79dec2404 (diff)
download0xbench-1772a907e73e188317c60d5d9561551e5d9b6c5f.tar.gz
Revert "Math -> Misc" and add Tab Misc
Add another tab *Misc* to contain Javascript benchmark. Keep Math there.
-rw-r--r--res/drawable/ic_misc.xml6
-rw-r--r--res/drawable/ic_misc_b.pngbin0 -> 864 bytes
-rw-r--r--res/drawable/ic_misc_w.pngbin0 -> 1147 bytes
-rw-r--r--src/org/zeroxlab/benchmark/Benchmark.java47
4 files changed, 36 insertions, 17 deletions
diff --git a/res/drawable/ic_misc.xml b/res/drawable/ic_misc.xml
new file mode 100644
index 0000000..e3befc3
--- /dev/null
+++ b/res/drawable/ic_misc.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:drawable="@drawable/ic_misc_b"
+ android:state_selected="true" />
+ <item android:drawable="@drawable/ic_misc_w" />
+</selector>
diff --git a/res/drawable/ic_misc_b.png b/res/drawable/ic_misc_b.png
new file mode 100644
index 0000000..a5c4bb6
--- /dev/null
+++ b/res/drawable/ic_misc_b.png
Binary files differ
diff --git a/res/drawable/ic_misc_w.png b/res/drawable/ic_misc_w.png
new file mode 100644
index 0000000..b8593f3
--- /dev/null
+++ b/res/drawable/ic_misc_w.png
Binary files differ
diff --git a/src/org/zeroxlab/benchmark/Benchmark.java b/src/org/zeroxlab/benchmark/Benchmark.java
index 64ca8e8..7ab4e09 100644
--- a/src/org/zeroxlab/benchmark/Benchmark.java
+++ b/src/org/zeroxlab/benchmark/Benchmark.java
@@ -113,26 +113,29 @@ public class Benchmark extends TabActivity implements View.OnClickListener {
private final String MAIN = "Main";
private final String D2 = "2D";
private final String D3 = "3D";
- private final String MISC = "Misc";
+ private final String MATH = "Math";
private final String VM = "VM";
private final String NATIVE = "Native";
+ private final String MISC = "Misc";
private CheckBox d2CheckBox;
private CheckBox d3CheckBox;
- private CheckBox miscCheckBox;
+ private CheckBox mathCheckBox;
private CheckBox vmCheckBox;
private CheckBox nativeCheckBox;
+ private CheckBox miscCheckBox;
private HashMap< String, HashSet<Case> > mCategory = new HashMap< String, HashSet<Case> >();
private final String trackerUrl = "http://0xbenchmark.appspot.com/static/MobileTracker.html";
boolean mAutoRun = false;
- boolean mCheckMisc = false;
+ boolean mCheckMath = false;
boolean mCheck2D = false;
boolean mCheck3D = false;
boolean mCheckVM = false;
boolean mCheckNative = false;
+ boolean mCheckMisc = false;
boolean mAutoUpload = false;
@Override
@@ -172,16 +175,17 @@ public class Benchmark extends TabActivity implements View.OnClickListener {
mCategory.put(D2, new HashSet<Case>());
mCategory.put(D3, new HashSet<Case>());
- mCategory.put(MISC, new HashSet<Case>());
+ mCategory.put(MATH, new HashSet<Case>());
mCategory.put(VM, new HashSet<Case>());
mCategory.put(NATIVE, new HashSet<Case>());
+ mCategory.put(MISC, new HashSet<Case>());
// mflops
mCases.add(arith);
mCases.add(scimark2);
mCases.add(javascript);
- mCategory.get(MISC).add(arith);
- mCategory.get(MISC).add(scimark2);
+ mCategory.get(MATH).add(arith);
+ mCategory.get(MATH).add(scimark2);
mCategory.get(MISC).add(javascript);
// 2d
@@ -229,7 +233,7 @@ public class Benchmark extends TabActivity implements View.OnClickListener {
Bundle bundle = intent.getExtras();
if (bundle != null) {
mAutoRun = bundle.getBoolean("autorun");
- mCheckMisc = bundle.getBoolean("misc");
+ mCheckMath = bundle.getBoolean("math");
mCheck2D = bundle.getBoolean("2d");
mCheck3D = bundle.getBoolean("3d");
mCheckVM = bundle.getBoolean("vm");
@@ -237,8 +241,8 @@ public class Benchmark extends TabActivity implements View.OnClickListener {
mAutoUpload = bundle.getBoolean("autoupload");
}
- if (mCheckMisc && !miscCheckBox.isChecked()) {
- miscCheckBox.performClick();
+ if (mCheckMath && !mathCheckBox.isChecked()) {
+ mathCheckBox.performClick();
}
if (mCheck2D && !d2CheckBox.isChecked()) {
@@ -256,6 +260,10 @@ public class Benchmark extends TabActivity implements View.OnClickListener {
if (mCheckNative && !nativeCheckBox.isChecked()) {
nativeCheckBox.performClick();
}
+
+ if (mCheckMisc && !miscCheckBox.isChecked()) {
+ miscCheckBox.performClick();
+ }
/*
if (intent.getBooleanExtra("AUTO", false)) {
ImageView head = (ImageView)findViewById(R.id.banner_img);
@@ -430,9 +438,9 @@ public class Benchmark extends TabActivity implements View.OnClickListener {
d3CheckBox.setText(D3);
d3CheckBox.setOnClickListener(Benchmark.this);
- miscCheckBox = new CheckBox(Benchmark.this);
- miscCheckBox.setText(MISC);
- miscCheckBox.setOnClickListener(Benchmark.this);
+ mathCheckBox = new CheckBox(Benchmark.this);
+ mathCheckBox.setText(MATH);
+ mathCheckBox.setOnClickListener(Benchmark.this);
vmCheckBox = new CheckBox(Benchmark.this);
vmCheckBox.setText(VM);
@@ -442,6 +450,10 @@ public class Benchmark extends TabActivity implements View.OnClickListener {
nativeCheckBox.setText(NATIVE);
nativeCheckBox.setOnClickListener(Benchmark.this);
+ miscCheckBox = new CheckBox(Benchmark.this);
+ miscCheckBox.setText(MISC);
+ miscCheckBox.setOnClickListener(Benchmark.this);
+
TextView mWebInfo = new TextView(Benchmark.this);
mWebInfo.setText("Uploaded results:\nhttp://0xbenchmark.appspot.com");
@@ -468,11 +480,12 @@ public class Benchmark extends TabActivity implements View.OnClickListener {
mTracker.loadUrl(trackerUrl);
mMainViewContainer.addView(mIconView,wrapContent);
mMainViewContainer.addView(mBannerInfo);
- mMainViewContainer.addView(miscCheckBox);
+ mMainViewContainer.addView(mathCheckBox);
mMainViewContainer.addView(d2CheckBox);
mMainViewContainer.addView(d3CheckBox);
mMainViewContainer.addView(vmCheckBox);
mMainViewContainer.addView(nativeCheckBox);
+ mMainViewContainer.addView(miscCheckBox);
mMainViewContainer.addView(mWebInfo);
mMainViewContainer.addView(mButtonContainer, fillWrap);
mMainViewContainer.addView(mTracker, 0,0);
@@ -515,10 +528,10 @@ public class Benchmark extends TabActivity implements View.OnClickListener {
mTabHost.addTab(mTabHost.newTabSpec(MAIN).setIndicator(MAIN, getResources().getDrawable(R.drawable.ic_eye)).setContent(mTCF));
mTabHost.addTab(mTabHost.newTabSpec(D2).setIndicator(D2, getResources().getDrawable(R.drawable.ic_2d)).setContent(mTCF));
mTabHost.addTab(mTabHost.newTabSpec(D3).setIndicator(D3, getResources().getDrawable(R.drawable.ic_3d)).setContent(mTCF));
- mTabHost.addTab(mTabHost.newTabSpec(MISC).setIndicator(MISC, getResources().getDrawable(R.drawable.ic_pi)).setContent(mTCF));
+ mTabHost.addTab(mTabHost.newTabSpec(MATH).setIndicator(MATH, getResources().getDrawable(R.drawable.ic_pi)).setContent(mTCF));
mTabHost.addTab(mTabHost.newTabSpec(VM).setIndicator(VM, getResources().getDrawable(R.drawable.ic_vm)).setContent(mTCF));
mTabHost.addTab(mTabHost.newTabSpec(NATIVE).setIndicator(NATIVE, getResources().getDrawable(R.drawable.ic_c)).setContent(mTCF));
-
+ mTabHost.addTab(mTabHost.newTabSpec(MISC).setIndicator(MISC, getResources().getDrawable(R.drawable.ic_misc)).setContent(mTCF));
}
public void onClick(View v) {
@@ -547,8 +560,8 @@ public class Benchmark extends TabActivity implements View.OnClickListener {
}
intent.setClassName(Report.packageName(), Report.fullClassName());
startActivity(intent);
- } else if (v == d2CheckBox || v == d3CheckBox || v == miscCheckBox ||
- v == vmCheckBox || v == nativeCheckBox) {
+ } else if (v == d2CheckBox || v == d3CheckBox || v == mathCheckBox ||
+ v == vmCheckBox || v == nativeCheckBox || v == miscCheckBox) {
int length = mCases.size();
String tag = ((CheckBox)v).getText().toString();
for (int i = 0; i < length; i++) {