diff options
author | Dianne Hackborn <hackbod@google.com> | 2011-11-01 15:28:43 -0700 |
---|---|---|
committer | Dianne Hackborn <hackbod@google.com> | 2011-11-01 18:01:33 -0700 |
commit | 0500b3cfda5192efc09d6d4344b0c6c785c0a815 (patch) | |
tree | d850844c43e6dacd62f9818f39a8becfd5ac5cbb /tests/FrameworkPerf | |
parent | f136aa341abaaf7fd6f7632d41a30b2989d93985 (diff) | |
download | frameworks_base-0500b3cfda5192efc09d6d4344b0c6c785c0a815.zip frameworks_base-0500b3cfda5192efc09d6d4344b0c6c785c0a815.tar.gz frameworks_base-0500b3cfda5192efc09d6d4344b0c6c785c0a815.tar.bz2 |
Some optimizations.
- Don't try to create a thumbnail bitmap on the client side. This
wastes 64k, and isn't needed since we are doing screenshots.
- Optimize View to put all of the callback pointers out of line.
Added a couple new APIs so these don't need to be protected/public.
- Lazily create ViewGroup's cache paint.
- Change FrameworkPerf app to not use HW accel drawing, to give better
comparison with GB.
Change-Id: Iec56d02459820d74a4cc9c7ec9c1856563c82c7b
Diffstat (limited to 'tests/FrameworkPerf')
-rw-r--r-- | tests/FrameworkPerf/AndroidManifest.xml | 2 | ||||
-rw-r--r-- | tests/FrameworkPerf/res/layout/main.xml | 17 | ||||
-rw-r--r-- | tests/FrameworkPerf/src/com/android/frameworkperf/FrameworkPerfActivity.java | 17 |
3 files changed, 28 insertions, 8 deletions
diff --git a/tests/FrameworkPerf/AndroidManifest.xml b/tests/FrameworkPerf/AndroidManifest.xml index c3fc837..aa663f3 100644 --- a/tests/FrameworkPerf/AndroidManifest.xml +++ b/tests/FrameworkPerf/AndroidManifest.xml @@ -3,7 +3,7 @@ <uses-permission android:name="android.permission.WAKE_LOCK" /> <uses-sdk android:minSdkVersion="5" /> - <application> + <application android:hardwareAccelerated="false"> <activity android:name="FrameworkPerfActivity" android:label="Framework Perf"> <intent-filter> <action android:name="android.intent.action.MAIN" /> diff --git a/tests/FrameworkPerf/res/layout/main.xml b/tests/FrameworkPerf/res/layout/main.xml index 8b54118..62b1a7a 100644 --- a/tests/FrameworkPerf/res/layout/main.xml +++ b/tests/FrameworkPerf/res/layout/main.xml @@ -64,6 +64,23 @@ android:orientation="horizontal" android:layout_marginTop="10dp" > + <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" + android:textAppearance="?android:attr/textAppearanceMedium" + android:text="Test time (ms): " + /> + <EditText android:id="@+id/testtime" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:inputType="number" + android:text="5000" + /> + </LinearLayout> + + <LinearLayout android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal" + android:layout_marginTop="10dp" + > <Button android:id="@+id/start" android:layout_width="wrap_content" android:layout_height="wrap_content" diff --git a/tests/FrameworkPerf/src/com/android/frameworkperf/FrameworkPerfActivity.java b/tests/FrameworkPerf/src/com/android/frameworkperf/FrameworkPerfActivity.java index 66e788c..5e15224 100644 --- a/tests/FrameworkPerf/src/com/android/frameworkperf/FrameworkPerfActivity.java +++ b/tests/FrameworkPerf/src/com/android/frameworkperf/FrameworkPerfActivity.java @@ -58,6 +58,7 @@ public class FrameworkPerfActivity extends Activity Spinner mFgSpinner; Spinner mBgSpinner; TextView mLog; + TextView mTestTime; PowerManager.WakeLock mPartialWakeLock; long mMaxRunTime = 5000; @@ -110,6 +111,7 @@ public class FrameworkPerfActivity extends Activity }; final Op[] mAvailOps = new Op[] { + null, new NoOp(), new CpuOp(), new SchedulerOp(), @@ -122,6 +124,8 @@ public class FrameworkPerfActivity extends Activity new ReadFileOp(), new ParseXmlResOp(), new ParseLargeXmlResOp(), + new LayoutInflaterOp(), + new LayoutInflaterLargeOp(), new LoadSmallBitmapOp(), new LoadLargeBitmapOp(), new LoadSmallScaledBitmapOp(), @@ -170,11 +174,14 @@ public class FrameworkPerfActivity extends Activity mAvailOpDescriptions = new String[mAvailOps.length]; for (int i=0; i<mAvailOps.length; i++) { Op op = mAvailOps[i]; - if (op.getClass() == NoOp.class) { + if (op == null) { mAvailOpLabels[i] = "All"; mAvailOpDescriptions[i] = "All tests"; } else { mAvailOpLabels[i] = op.getName(); + if (mAvailOpLabels[i] == null) { + mAvailOpLabels[i] = "Nothing"; + } mAvailOpDescriptions[i] = op.getLongName(); } } @@ -211,6 +218,7 @@ public class FrameworkPerfActivity extends Activity stopRunning(); } }); + mTestTime = (TextView)findViewById(R.id.testtime); mLog = (TextView)findViewById(R.id.log); PowerManager pm = (PowerManager)getSystemService(POWER_SERVICE); @@ -221,11 +229,7 @@ public class FrameworkPerfActivity extends Activity @Override public void onItemSelected(AdapterView<?> parent, View view, int position, long id) { if (parent == mFgSpinner || parent == mBgSpinner) { - Spinner spinner = (Spinner)parent; Op op = mAvailOps[position]; - if (op.getClass() == NoOp.class) { - op = null; - } if (parent == mFgSpinner) { mFgTest = op; ((TextView)findViewById(R.id.fgtext)).setText(mAvailOpDescriptions[position]); @@ -238,8 +242,6 @@ public class FrameworkPerfActivity extends Activity @Override public void onNothingSelected(AdapterView<?> parent) { - // TODO Auto-generated method stub - } @Override @@ -314,6 +316,7 @@ public class FrameworkPerfActivity extends Activity updateWakeLock(); startService(new Intent(this, SchedulerService.class)); mCurOpIndex = 0; + mMaxRunTime = Integer.parseInt(mTestTime.getText().toString()); mResults.clear(); startCurOp(); } |