From 1542f74d866056aac0cc5ffc328940a4b8ba626c Mon Sep 17 00:00:00 2001 From: Grace Kloba Date: Wed, 17 Mar 2010 21:11:15 -0700 Subject: [PATCH] Do not call invalidate() in draw(). This improved Browser loading performance by 10%. Loading nytimes.com on Sholes with plugin dropped from 30s to 26s. As FakedTitleBar is shown while a page is loading, there is no need to update the WebView TitleBar's progress which is always behind.This improved Browser loading performance by another 10%. Loading nytimes.com on Sholes with plugin dropped from 26s to 23s. Fix http://b/issue?id=2520517 --- src/com/android/browser/BrowserActivity.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java index 4c8fc5c..2012f61 100644 --- a/src/com/android/browser/BrowserActivity.java +++ b/src/com/android/browser/BrowserActivity.java @@ -214,6 +214,8 @@ public class BrowserActivity extends Activity .findViewById(R.id.fullscreen_custom_content); frameLayout.addView(mBrowserFrameLayout, COVER_SCREEN_PARAMS); mTitleBar = new TitleBar(this); + // mTitleBar will be always shown in the fully loaded mode + mTitleBar.setProgress(100); mFakeTitleBar = new TitleBar(this); // Create the tab control and our initial tab @@ -832,9 +834,6 @@ public class BrowserActivity extends Activity if (mWebView == null || mWebView.getScrollY() > getHeight()) { super.draw(canvas); } - // Need to invalidate so that if the scroll position changes, we - // still draw as appropriate. - invalidate(); } } @@ -2659,7 +2658,6 @@ public class BrowserActivity extends Activity // ------------------------------------------------------------------------- void onProgressChanged(WebView view, int newProgress) { - mTitleBar.setProgress(newProgress); mFakeTitleBar.setProgress(newProgress); if (newProgress == 100) { -- 2.11.0