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
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 @@
.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 @@
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 @@
// -------------------------------------------------------------------------
void onProgressChanged(WebView view, int newProgress) {
- mTitleBar.setProgress(newProgress);
mFakeTitleBar.setProgress(newProgress);
if (newProgress == 100) {