Bug 737510 - Print something useful when dumping an ImmutableViewportMetrics. r=Cwiiis a=akeybl
authorKartikaya Gupta <kgupta@mozilla.com>
Mon, 23 Apr 2012 23:52:58 -0400
changeset 95537 2b354dbf7b30b567265b9af21795b2836a4d4b37
parent 95536 777c0bd7dd5d8421007d88b2ea45cee5cf3a71f8
child 95538 2d9150554eaa7ae244d85e01a23a62f9bdc91d95
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersCwiiis, akeybl
bugs737510
milestone14.0a2
Bug 737510 - Print something useful when dumping an ImmutableViewportMetrics. r=Cwiiis a=akeybl
mobile/android/base/gfx/DisplayPortMetrics.java
mobile/android/base/gfx/ImmutableViewportMetrics.java
--- a/mobile/android/base/gfx/DisplayPortMetrics.java
+++ b/mobile/android/base/gfx/DisplayPortMetrics.java
@@ -38,14 +38,15 @@ public final class DisplayPortMetrics {
           .append(", \"top\": ").append(mPosition.top)
           .append(", \"right\": ").append(mPosition.right)
           .append(", \"bottom\": ").append(mPosition.bottom)
           .append(", \"resolution\": ").append(mResolution)
           .append('}');
         return sb.toString();
     }
 
+    @Override
     public String toString() {
-        return "DisplayPortMetrics(" + mPosition.left + ","
+        return "DisplayPortMetrics v=(" + mPosition.left + ","
                 + mPosition.top + "," + mPosition.right + ","
-                + mPosition.bottom + "," + mResolution + ")";
+                + mPosition.bottom + ") z=" + mResolution;
     }
 }
--- a/mobile/android/base/gfx/ImmutableViewportMetrics.java
+++ b/mobile/android/base/gfx/ImmutableViewportMetrics.java
@@ -76,9 +76,16 @@ public class ImmutableViewportMetrics {
 
     public FloatSize getPageSize() {
         return new FloatSize(pageSizeWidth, pageSizeHeight);
     }
 
     public FloatSize getCssPageSize() {
         return new FloatSize(cssPageSizeWidth, cssPageSizeHeight);
     }
+
+    @Override
+    public String toString() {
+        return "ImmutableViewportMetrics v=(" + viewportRectLeft + "," + viewportRectTop + ","
+                + viewportRectRight + "," + viewportRectBottom + ") p=(" + pageSizeWidth + ","
+                + pageSizeHeight + ") z=" + zoomFactor;
+    }
 }