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
--- 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();