Bug 1107636 - Replace top-level RelativeLayout with <merge>. r=sebastian

Using systrace, I took 2 traces before and after. Using the slowest
of both traces, the first three measure passes had the following
improvements in CPU time:
  1) 20.583ms -> 13.149ms
  2) 1.695ms -> 0.827ms (1/2)
  3) 22.146ms -> 11.602ms (1/2)

This is to be expected – RelativeLayout requires two measure passes
so it makes sense to approximately half the measure times.

--HG--
extra : commitid : IDQckTgGsge
extra : rebase_source : df061c7645aa6b3a880278f75d3fa637e3160f9c
This commit is contained in:
Michael Comella 2015-11-06 15:23:47 -08:00
Родитель a54b717a42
Коммит c86bfabebb
3 изменённых файлов: 4 добавлений и 9 удалений

Просмотреть файл

@ -170,7 +170,7 @@ public abstract class GeckoApp
// after a version upgrade.
private static final int CLEANUP_DEFERRAL_SECONDS = 15;
protected RelativeLayout mRootLayout;
protected View mRootLayout;
protected RelativeLayout mMainLayout;
protected RelativeLayout mGeckoLayout;
@ -1385,7 +1385,7 @@ public abstract class GeckoApp
setContentView(getLayout());
// Set up Gecko layout.
mRootLayout = (RelativeLayout) findViewById(R.id.root_layout);
mRootLayout = findViewById(android.R.id.content);
mGeckoLayout = (RelativeLayout) findViewById(R.id.gecko_layout);
mMainLayout = (RelativeLayout) findViewById(R.id.main_layout);
mLayerView = (LayerView) findViewById(R.id.layer_view);

Просмотреть файл

@ -3,10 +3,7 @@
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/root_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<ViewStub android:id="@+id/tabs_panel"
android:layout="@layout/tabs_panel_view"
@ -150,4 +147,4 @@
android:layout="@layout/button_toast"
style="@style/Toast"/>
</RelativeLayout>
</merge>

Просмотреть файл

@ -638,8 +638,6 @@
<item name="android:background">@drawable/toast_background</item>
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_alignParentBottom">true</item>
<item name="android:layout_centerHorizontal">true</item>
<item name="android:layout_gravity">bottom|center_horizontal</item>
<item name="android:layout_marginBottom">64dp</item>
<item name="android:layout_marginTop">0dp</item>