Back out 35bf7e6dbf90 (bug 882120) for reftest and crashtest failures
authorPhil Ringnalda <philringnalda@gmail.com>
Tue, 18 Jun 2013 09:00:56 -0700
changeset 135483 86ae36fa3ea2a264e27184d459de175021577ef7
parent 135482 e4dd6f0845c509754083302cd9c0347ce188830a
child 135484 d5b59c74871e627869f7399015f02b62bb5bd839
push id24841
push userryanvm@gmail.com
push dateTue, 18 Jun 2013 23:04:53 +0000
treeherdermozilla-central@d2a7cfa34154 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs882120
milestone24.0a1
backs out35bf7e6dbf9001248158283ab7ce7e1652845019
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Back out 35bf7e6dbf90 (bug 882120) for reftest and crashtest failures
mobile/android/base/gfx/GeckoLayerClient.java
mobile/android/base/gfx/RectUtils.java
--- a/mobile/android/base/gfx/GeckoLayerClient.java
+++ b/mobile/android/base/gfx/GeckoLayerClient.java
@@ -555,22 +555,20 @@ public class GeckoLayerClient implements
     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)
+                .setPageRect(RectUtils.scale(cssPageRect, zoom), cssPageRect)
                 .setIsRTL(tab.getIsRTL());
             // Since we have switched to displaying a different document, we need to update any
             // viewport-related state we have lying around. This includes mGeckoViewport and
             // mViewportMetrics. Usually this information is updated via handleViewportMessage
             // while we remain on the same document.
             post(new Runnable() {
                 @Override
                 public void run() {
@@ -607,20 +605,19 @@ public class GeckoLayerClient implements
     /** This function is invoked by Gecko via JNI; be careful when modifying signature.
       * The compositor invokes this function whenever it determines that the page rect
       * has changed (based on the information it gets from layout). If setFirstPaintViewport
       * is invoked on a frame, then this function will not be. For any given frame, this
       * function will be invoked before syncViewportInfo.
       */
     public void setPageRect(float cssPageLeft, float cssPageTop, float cssPageRight, float cssPageBottom) {
         synchronized (getLock()) {
+            RectF cssPageRect = new RectF(cssPageLeft, cssPageTop, cssPageRight, cssPageBottom);
             float ourZoom = getViewportMetrics().zoomFactor;
-            RectF cssPageRect = new RectF(cssPageLeft, cssPageTop, cssPageRight, cssPageBottom);
-            RectF pageRect = RectUtils.scaleAndRound(cssPageRect, ourZoom);
-            setPageRect(pageRect, cssPageRect);
+            setPageRect(RectUtils.scale(cssPageRect, ourZoom), cssPageRect);
             // Here the page size of the document has changed, but the document being displayed
             // is still the same. Therefore, we don't need to send anything to browser.js; any
             // changes we need to make to the display port will get sent the next time we call
             // adjustViewport().
         }
     }
 
     /** This function is invoked by Gecko via JNI; be careful when modifying signature.
--- a/mobile/android/base/gfx/RectUtils.java
+++ b/mobile/android/base/gfx/RectUtils.java
@@ -69,25 +69,16 @@ public final class RectUtils {
     public static RectF scale(RectF rect, float scale) {
         float x = rect.left * scale;
         float y = rect.top * scale;
         return new RectF(x, y,
                          x + (rect.width() * scale),
                          y + (rect.height() * scale));
     }
 
-    public static RectF scaleAndRound(RectF rect, float scale) {
-        float left = rect.left * scale;
-        float top = rect.top * scale;
-        return new RectF(Math.round(left),
-                         Math.round(top),
-                         Math.round(left + (rect.width() * scale)),
-                         Math.round(top + (rect.height() * scale)));
-    }
-
     /** Returns the nearest integer rect of the given rect. */
     public static Rect round(RectF rect) {
         Rect r = new Rect();
         round(rect, r);
         return r;
     }
 
     public static void round(RectF rect, Rect dest) {