Faster all the things!
Bug: 5177959
Improve browser startup. Elinate IO access on UI thread during startup
by removing the super legacy ClearThumbnails task. Also rework how
the hardware acceleration debug setting works to remove the requirement
for initialized BrowserSettings in onCreate
Change-Id: I4c1014d380827af4833586e6a3ae842fd59aa48b
diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java
index abc2467..d7ce29b 100644
--- a/src/com/android/browser/Tab.java
+++ b/src/com/android/browser/Tab.java
@@ -1664,6 +1664,7 @@
void resume() {
if (mMainView != null) {
+ setupHwAcceleration(mMainView);
mMainView.onResume();
if (mSubView != null) {
mSubView.onResume();
@@ -1671,6 +1672,16 @@
}
}
+ private void setupHwAcceleration(View web) {
+ if (web == null) return;
+ BrowserSettings settings = BrowserSettings.getInstance();
+ if (settings.isHardwareAccelerated()) {
+ web.setLayerType(View.LAYER_TYPE_NONE, null);
+ } else {
+ web.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
+ }
+ }
+
void pause() {
if (mMainView != null) {
mMainView.onPause();