Bug 709658 - Do not startup GL until we are ready to paint something. r=blassey a=cjones
authorDoug Turner <dougt@dougt.org>
Mon, 12 Dec 2011 17:09:40 +0800
changeset 84422 bcc015450e7a2ef9d23256adf266017461f08fc1
parent 84421 0ce8da61c6cc43f6626638b5f59cf15a30cb0621
child 84423 50a9ea86cd441c6ab46b35f801376a202964c54e
push id114
push userffxbld
push dateFri, 09 Mar 2012 01:01:18 +0000
treeherdermozilla-release@c081ebf13261 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersblassey, cjones
bugs709658
milestone11.0a1
first release with
nightly win64
bcc015450e7a / 11.0a1 / 20111212031122 / files
nightly linux32
nightly linux64
nightly mac
nightly win32
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly win64
Bug 709658 - Do not startup GL until we are ready to paint something. r=blassey a=cjones
mobile/android/base/GeckoApp.java
--- a/mobile/android/base/GeckoApp.java
+++ b/mobile/android/base/GeckoApp.java
@@ -881,21 +881,21 @@ abstract public class GeckoApp
                 handleDoorHangerRemove(message);
             } else if (event.equals("Gecko:Ready")) {
                 sIsGeckoReady = true;
                 mMainHandler.post(new Runnable() {
                     public void run() {
                         if (sMenu != null)
                             sMenu.findItem(R.id.preferences).setEnabled(true);
                         Looper.myQueue().addIdleHandler(new UpdateIdleHandler());
+                        connectGeckoLayerClient();
                     }
                 });
                 setLaunchState(GeckoApp.LaunchState.GeckoRunning);
                 GeckoAppShell.sendPendingEventsToGecko();
-                connectGeckoLayerClient();
             } else if (event.equals("ToggleChrome:Hide")) {
                 mMainHandler.post(new Runnable() {
                     public void run() {
                         mBrowserToolbar.setVisibility(View.GONE);
                     }
                 });
             } else if (event.equals("ToggleChrome:Show")) {
                 mMainHandler.post(new Runnable() {
@@ -1322,23 +1322,28 @@ abstract public class GeckoApp
              * and zoom a cached screenshot of the previous page. This call will return null if
              * there is no cached screenshot; in that case, we have no choice but to display a
              * checkerboard.
              *
              * TODO: Fall back to a built-in screenshot of the Fennec Start page for a nice first-
              * run experience, perhaps?
              */
             mLayerController = new LayerController(this);
-            mPlaceholderLayerClient = mUserDefinedProfile ?  null :
-                PlaceholderLayerClient.createInstance(this);
-            if (mPlaceholderLayerClient != null) {
-                mLayerController.setLayerClient(mPlaceholderLayerClient);
+            if (mUserDefinedProfile != true &&
+                GeckoApp.mAppContext.mLastScreen != null) {
+                mPlaceholderLayerClient = PlaceholderLayerClient.createInstance(this);
+                if (mPlaceholderLayerClient != null) {
+                    mLayerController.setLayerClient(mPlaceholderLayerClient);
+                    mGeckoLayout.addView(mLayerController.getView(), 0);
+                    if (mLastUri != null && mLastTitle != null) { 
+                        GeckoAppShell.sendEventToGecko(new GeckoEvent(mLastUri));
+                        mBrowserToolbar.setTitle(mLastTitle);
+                    }
+                }
             }
-
-            mGeckoLayout.addView(mLayerController.getView(), 0);
         }
 
         mPluginContainer = (AbsoluteLayout) findViewById(R.id.plugin_container);
 
         Log.w(LOGTAG, "zerdatime " + new Date().getTime() + " - UI almost up");
 
         if (sGREDir == null)
             sGREDir = new File(this.getApplicationInfo().dataDir);
@@ -2012,18 +2017,23 @@ abstract public class GeckoApp
     }
 
     public void onStatusChanged(String provider, int status, Bundle extras)
     {
     }
 
 
     private void connectGeckoLayerClient() {
-        if (mPlaceholderLayerClient != null)
+        if (mPlaceholderLayerClient != null) {
             mPlaceholderLayerClient.destroy();
+        }
+        else {
+            // we didn't add a view before, add one now.
+            mGeckoLayout.addView(mLayerController.getView(), 0);
+        }
 
         LayerController layerController = getLayerController();
         layerController.setLayerClient(mSoftwareLayerClient);
     }
 
     private void prefetchDNS(final Uri u) {
         // resolving the host here starts up the radio
         // and may prime the dns cache.  See