Enable zooming.
authorAli Juma <ajuma@mozilla.com>
Sun, 12 Feb 2012 15:06:34 -0500
changeset 92438 f290028f4842831ac03990fbcb2bd1bef8d0a994
parent 92437 2a128563daedfa8bc1e2b1b9c312f958255292dc
child 92439 da5a0253074ee71d1913dab6f0e3b1a2ffb597af
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)
milestone13.0a1
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
Enable zooming.
gfx/layers/ipc/CompositorParent.cpp
mobile/android/chrome/content/browser.js
--- a/gfx/layers/ipc/CompositorParent.cpp
+++ b/gfx/layers/ipc/CompositorParent.cpp
@@ -279,18 +279,18 @@ CompositorParent::TransformShadowTree(La
   ViewTransform layerTransform = aTransform;
 
   ContainerLayer* container = aLayer->AsContainerLayer();
 
   if (container && container->GetFrameMetrics().IsScrollable()) {
     const FrameMetrics* metrics = &container->GetFrameMetrics();
     const gfx3DMatrix& currentTransform = aLayer->GetTransform();
 
-    aTempScaleDiffX *= GetXScale(shadowTransform);
-    aTempScaleDiffY *= GetYScale(shadowTransform);
+    aTempScaleDiffX *= GetXScale(shadowTransform) * mXScale;
+    aTempScaleDiffY *= GetYScale(shadowTransform) * mYScale;
 
     nsIntPoint metricsScrollOffset = metrics->mViewportScrollOffset;
 
     nsIntPoint scrollCompensation(
         (mScrollOffset.x / aTempScaleDiffX - metricsScrollOffset.x) * mXScale,
         (mScrollOffset.y / aTempScaleDiffY - metricsScrollOffset.y) * mYScale);
     ViewTransform treeTransform(-scrollCompensation, mXScale,
                                 mYScale);
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -1580,19 +1580,20 @@ Tab.prototype = {
       this.viewportExcess.x = excessX;
     }
     if ((aViewport.offsetY != this._viewport.offsetY) ||
         (excessY != this.viewportExcess.y)) {
       this._viewport.offsetY = aViewport.offsetY;
       this.viewportExcess.y = excessY;
     }
     if (Math.abs(aViewport.zoom - this._viewport.zoom) >= 1e-6) {
-      //FIXME: Uncomment once zoom is working again.
-      //this._viewport.zoom = aViewport.zoom;
-      this._viewport.zoom = 1;
+      this._viewport.zoom = aViewport.zoom;
+      let cwu = window.top.QueryInterface(Ci.nsIInterfaceRequestor)
+                           .getInterface(Ci.nsIDOMWindowUtils);
+      cwu.setResolution(this._viewport.zoom, this._viewport.zoom);
     }
   },
 
   screenshot: function(aSrc, aDst) {
       // FIXME: Reenable
       //if (!this.browser || !this.browser.contentWindow)
         return;
 
@@ -1668,19 +1669,17 @@ Tab.prototype = {
 
   updateViewport: function(aReset, aZoomLevel) {
     dump("### JS side updateViewport " + aReset + " zoom " + aZoomLevel + "\n");
 
     if (!aZoomLevel)
       aZoomLevel = this.getDefaultZoomLevel();
 
     let win = this.browser.contentWindow;
-    //FIXME: Uncomment when zoom is working again.
-    //let zoom = (aReset ? aZoomLevel : this._viewport.zoom);
-    let zoom = 1;
+    let zoom = (aReset ? aZoomLevel : this._viewport.zoom);
     let xpos = ((aReset && win) ? win.scrollX * zoom : this._viewport.x);
     let ypos = ((aReset && win) ? win.scrollY * zoom : this._viewport.y);
 
     this.viewportExcess = { x: 0, y: 0 };
     this.viewport = { x: xpos, y: ypos,
                       offsetX: 0, offsetY: 0,
                       width: this._viewport.width, height: this._viewport.height,
                       pageWidth: gScreenWidth, pageHeight: gScreenHeight,