From c86bfabebbe3a0c09527bfc484ca506450942d67 Mon Sep 17 00:00:00 2001 From: Michael Comella Date: Fri, 6 Nov 2015 15:23:47 -0800 Subject: [PATCH] Bug 1107636 - Replace top-level RelativeLayout with . r=sebastian MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- mobile/android/base/GeckoApp.java | 4 ++-- mobile/android/base/resources/layout/gecko_app.xml | 7 ++----- mobile/android/base/resources/values/styles.xml | 2 -- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/mobile/android/base/GeckoApp.java b/mobile/android/base/GeckoApp.java index 01f4238e9766..5d708da3a6d0 100644 --- a/mobile/android/base/GeckoApp.java +++ b/mobile/android/base/GeckoApp.java @@ -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); diff --git a/mobile/android/base/resources/layout/gecko_app.xml b/mobile/android/base/resources/layout/gecko_app.xml index a9023495d8a0..d71cb69b5a6a 100644 --- a/mobile/android/base/resources/layout/gecko_app.xml +++ b/mobile/android/base/resources/layout/gecko_app.xml @@ -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/. --> - + - + diff --git a/mobile/android/base/resources/values/styles.xml b/mobile/android/base/resources/values/styles.xml index 4fe9f26a72a6..dd35aeee88dc 100644 --- a/mobile/android/base/resources/values/styles.xml +++ b/mobile/android/base/resources/values/styles.xml @@ -638,8 +638,6 @@ @drawable/toast_background match_parent wrap_content - true - true bottom|center_horizontal 64dp 0dp