Bug 1258470 - Part 4: MOZ_ANDROID_APZ implies no need for functional getDisplayPort. draft
authorNick Alexander <nalexander@mozilla.com>
Tue, 21 Jun 2016 10:26:04 -0700
changeset 380996 3052f52a5658b72815116d3a57b2a6dd92ac61d8
parent 380995 7bbc493d4480356fa29d46629a20e5b75b13df51
child 380997 309b70ce9ddb237667e9011007ac1e90c97aab27
push id21383
push usernalexander@mozilla.com
push dateFri, 24 Jun 2016 00:16:43 +0000
bugs1258470
milestone50.0a1
Bug 1258470 - Part 4: MOZ_ANDROID_APZ implies no need for functional getDisplayPort. MozReview-Commit-ID: 6JV9mTGIsjU
mobile/android/base/java/org/mozilla/gecko/gfx/GeckoLayerClient.java
mobile/android/chrome/content/browser.js
--- a/mobile/android/base/java/org/mozilla/gecko/gfx/GeckoLayerClient.java
+++ b/mobile/android/base/java/org/mozilla/gecko/gfx/GeckoLayerClient.java
@@ -412,29 +412,17 @@ class GeckoLayerClient implements LayerV
             setViewportMetrics(newMetrics, type == ViewportMessageType.UPDATE);
             mDisplayPort = DisplayPortCalculator.calculate(getViewportMetrics(), null);
         }
         return mDisplayPort;
     }
 
     @WrapForJNI
     DisplayPortMetrics getDisplayPort(boolean pageSizeUpdate, boolean isBrowserContentDisplayed, int tabId, ImmutableViewportMetrics metrics) {
-        Tabs tabs = Tabs.getInstance();
-        if (isBrowserContentDisplayed && tabs.isSelectedTabId(tabId)) {
-            // for foreground tabs, send the viewport update unless the document
-            // displayed is different from the content document. In that case, just
-            // calculate the display port.
-            return handleViewportMessage(metrics, pageSizeUpdate ? ViewportMessageType.PAGE_SIZE : ViewportMessageType.UPDATE);
-        } else {
-            // for background tabs, request a new display port calculation, so that
-            // when we do switch to that tab, we have the correct display port and
-            // don't need to draw twice (once to allow the first-paint viewport to
-            // get to java, and again once java figures out the display port).
-            return DisplayPortCalculator.calculate(metrics, null);
-        }
+        return null;
     }
 
     @WrapForJNI
     void contentDocumentChanged() {
         mContentDocumentIsDisplayed = false;
     }
 
     @WrapForJNI
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -3866,20 +3866,16 @@ Tab.prototype = {
 
     return viewport;
   },
 
   sendViewportUpdate: function(aPageSizeUpdate) {
     if (AppConstants.MOZ_ANDROID_APZ) {
       return;
     }
-    let viewport = this.getViewport();
-    let displayPort = Services.androidBridge.getDisplayPort(aPageSizeUpdate, BrowserApp.isBrowserContentDocumentDisplayed(), this.id, viewport);
-    if (displayPort != null)
-      this.setDisplayPort(displayPort);
   },
 
   // These constants are used to prioritize high quality metadata over low quality data, so that
   // we can collect data as we find meta tags, and replace low quality metadata with higher quality
   // matches. For instance a msApplicationTile icon is a better tile image than an og:image tag.
   METADATA_GOOD_MATCH: 10,
   METADATA_NORMAL_MATCH: 1,