Bug 1258470 - Part 5: Remove use of Tab for background color. draft
authorNick Alexander <nalexander@mozilla.com>
Tue, 21 Jun 2016 10:32:47 -0700
changeset 380997 309b70ce9ddb237667e9011007ac1e90c97aab27
parent 380996 3052f52a5658b72815116d3a57b2a6dd92ac61d8
child 380998 1c69c10d3f5f6015ecb7cdb6dfe26e555276cad1
push id21383
push usernalexander@mozilla.com
push dateFri, 24 Jun 2016 00:16:43 +0000
bugs1258470
milestone50.0a1
Bug 1258470 - Part 5: Remove use of Tab for background color. I can't justify this: I'm just doing it to get Tab and Tabs out of the omg.gfx package. I think this will change behaviour, since I can't find an explanation for why it wouldn't. MozReview-Commit-ID: 8xoQbnW2Igw
mobile/android/base/java/org/mozilla/gecko/gfx/GeckoLayerClient.java
--- a/mobile/android/base/java/org/mozilla/gecko/gfx/GeckoLayerClient.java
+++ b/mobile/android/base/java/org/mozilla/gecko/gfx/GeckoLayerClient.java
@@ -5,18 +5,16 @@
 
 package org.mozilla.gecko.gfx;
 
 import org.mozilla.gecko.annotation.RobocopTarget;
 import org.mozilla.gecko.annotation.WrapForJNI;
 import org.mozilla.gecko.GeckoAppShell;
 import org.mozilla.gecko.GeckoEvent;
 import org.mozilla.gecko.gfx.LayerView.DrawListener;
-import org.mozilla.gecko.Tab;
-import org.mozilla.gecko.Tabs;
 import org.mozilla.gecko.EventDispatcher;
 import org.mozilla.gecko.util.FloatUtils;
 import org.mozilla.gecko.AppConstants;
 
 import android.content.Context;
 import android.graphics.PointF;
 import android.graphics.RectF;
 import android.os.SystemClock;
@@ -539,18 +537,16 @@ class GeckoLayerClient implements LayerV
       * this function is invoked on; and this function will always be called prior to syncViewportInfo.
       */
     @WrapForJNI(allowMultithread = true)
     public void setFirstPaintViewport(float offsetX, float offsetY, float zoom,
             float cssPageLeft, float cssPageTop, float cssPageRight, float cssPageBottom) {
         synchronized (getLock()) {
             ImmutableViewportMetrics currentMetrics = getViewportMetrics();
 
-            Tab tab = Tabs.getInstance().getSelectedTab();
-
             RectF cssPageRect = new RectF(cssPageLeft, cssPageTop, cssPageRight, cssPageBottom);
             RectF pageRect = RectUtils.scaleAndRound(cssPageRect, zoom);
 
             final ImmutableViewportMetrics newMetrics = currentMetrics
                 .setViewportOrigin(offsetX, offsetY)
                 .setZoomFactor(zoom)
                 .setPageRect(pageRect, cssPageRect);
             // Since we have switched to displaying a different document, we need to update any
@@ -561,20 +557,16 @@ class GeckoLayerClient implements LayerV
                 @Override
                 public void run() {
                     mGeckoViewport = newMetrics;
                 }
             });
 
             setViewportMetrics(newMetrics);
 
-            if (tab != null) {
-                mView.setBackgroundColor(tab.getBackgroundColor());
-            }
-
             // At this point, we have just switched to displaying a different document than we
             // we previously displaying. This means we need to abort any panning/zooming animations
             // that are in progress and send an updated display port request to browser.js as soon
             // as possible. The call to PanZoomController.abortAnimation accomplishes this by calling the
             // forceRedraw function, which sends the viewport to gecko. The display port request is
             // actually a full viewport update, which is fine because if browser.js has somehow moved to
             // be out of sync with this first-paint viewport, then we force them back in sync.
             abortPanZoomAnimation();