Backed out 3 changesets (bug 923512) for mochitest-2 bustage on a CLOSED TREE
authorWes Kocher <wkocher@mozilla.com>
Wed, 06 Aug 2014 16:36:35 -0700
changeset 219871 d577815636c664aaadf696e5277baa8cf6db4b68
parent 219870 e8b07667f3ccb30c7a2a3d8145ffdedbeebb5ce6
child 219872 3433804a42b16487c62d73a2e6058bb31f777574
push id3979
push userraliiev@mozilla.com
push dateMon, 13 Oct 2014 16:35:44 +0000
treeherdermozilla-beta@30f2cc610691 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs923512
milestone34.0a1
backs outf8720d81b74fe6833e442d82d6b595ae50a4b736
f431232084b76b35809d0d2c703b1b3f3666e7e0
dff51863663c0a8d3788f07b1e6f140920ce1d88
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
Backed out 3 changesets (bug 923512) for mochitest-2 bustage on a CLOSED TREE Backed out changeset f8720d81b74f (bug 923512) Backed out changeset f431232084b7 (bug 923512) Backed out changeset dff51863663c (bug 923512)
content/base/public/Element.h
dom/canvas/CanvasRenderingContext2D.cpp
dom/canvas/CanvasRenderingContext2D.h
dom/events/EventStateManager.cpp
gfx/2d/BaseCoord.h
gfx/2d/BasePoint.h
gfx/2d/Blur.cpp
gfx/2d/Coord.h
gfx/2d/DrawTargetD2D.cpp
gfx/2d/DrawTargetTiled.cpp
gfx/2d/HelpersD2D.h
gfx/2d/Path.cpp
gfx/2d/PathHelpers.h
gfx/2d/PathSkia.cpp
gfx/2d/Point.h
gfx/2d/SVGTurbulenceRenderer-inl.h
gfx/2d/moz.build
gfx/2d/unittest/TestPoint.cpp
gfx/ipc/GfxMessageUtils.h
gfx/layers/apz/src/APZCTreeManager.cpp
gfx/layers/apz/src/AsyncPanZoomController.cpp
gfx/layers/apz/src/Axis.cpp
gfx/layers/apz/src/Axis.h
gfx/layers/client/ClientTiledThebesLayer.cpp
gfx/layers/client/TiledContentClient.cpp
gfx/layers/composite/ContainerLayerComposite.cpp
gfx/layers/opengl/CompositorOGL.cpp
layout/base/UnitTransforms.h
layout/base/Units.h
widget/xpwidgets/nsBaseWidget.cpp
--- a/content/base/public/Element.h
+++ b/content/base/public/Element.h
@@ -723,30 +723,30 @@ public:
   void ScrollIntoView()
   {
     ScrollIntoView(true);
   }
   void ScrollIntoView(bool aTop);
   int32_t ScrollTop()
   {
     nsIScrollableFrame* sf = GetScrollFrame();
-    return sf ? sf->GetScrollPositionCSSPixels().y.value : 0;
+    return sf ? sf->GetScrollPositionCSSPixels().y : 0;
   }
   void SetScrollTop(int32_t aScrollTop)
   {
     nsIScrollableFrame* sf = GetScrollFrame();
     if (sf) {
       sf->ScrollToCSSPixels(CSSIntPoint(sf->GetScrollPositionCSSPixels().x,
                                         aScrollTop));
     }
   }
   int32_t ScrollLeft()
   {
     nsIScrollableFrame* sf = GetScrollFrame();
-    return sf ? sf->GetScrollPositionCSSPixels().x.value : 0;
+    return sf ? sf->GetScrollPositionCSSPixels().x : 0;
   }
   void SetScrollLeft(int32_t aScrollLeft)
   {
     nsIScrollableFrame* sf = GetScrollFrame();
     if (sf) {
       sf->ScrollToCSSPixels(CSSIntPoint(aScrollLeft,
                                         sf->GetScrollPositionCSSPixels().y));
     }
--- a/dom/canvas/CanvasRenderingContext2D.cpp
+++ b/dom/canvas/CanvasRenderingContext2D.cpp
@@ -1980,17 +1980,17 @@ CanvasRenderingContext2D::ArcTo(double x
   bool anticlockwise;
 
   if (p0 == p1 || p1 == p2 || radius == 0) {
     LineTo(p1.x, p1.y);
     return;
   }
 
   // Check for colinearity
-  dir = (p2.x - p1.x).value * (p0.y - p1.y).value + (p2.y - p1.y).value * (p1.x - p0.x).value;
+  dir = (p2.x - p1.x) * (p0.y - p1.y) + (p2.y - p1.y) * (p1.x - p0.x);
   if (dir == 0) {
     LineTo(p1.x, p1.y);
     return;
   }
 
 
   // XXX - Math for this code was already available from the non-azure code
   // and would be well tested. Perhaps converting to bezier directly might
@@ -4495,17 +4495,17 @@ CanvasPath::ArcTo(double x1, double y1, 
   bool anticlockwise;
 
   if (p0 == p1 || p1 == p2 || radius == 0) {
     LineTo(p1.x, p1.y);
     return;
   }
 
   // Check for colinearity
-  dir = (p2.x - p1.x).value * (p0.y - p1.y).value + (p2.y - p1.y).value * (p1.x - p0.x).value;
+  dir = (p2.x - p1.x) * (p0.y - p1.y) + (p2.y - p1.y) * (p1.x - p0.x);
   if (dir == 0) {
     LineTo(p1.x, p1.y);
     return;
   }
 
 
   // XXX - Math for this code was already available from the non-azure code
   // and would be well tested. Perhaps converting to bezier directly might
--- a/dom/canvas/CanvasRenderingContext2D.h
+++ b/dom/canvas/CanvasRenderingContext2D.h
@@ -785,17 +785,17 @@ protected:
     */
   bool NeedToDrawShadow()
   {
     const ContextState& state = CurrentState();
 
     // The spec says we should not draw shadows if the operator is OVER.
     // If it's over and the alpha value is zero, nothing needs to be drawn.
     return NS_GET_A(state.shadowColor) != 0 &&
-      (state.shadowBlur != 0.f || state.shadowOffset.x != 0.f || state.shadowOffset.y != 0.f);
+      (state.shadowBlur != 0 || state.shadowOffset.x != 0 || state.shadowOffset.y != 0);
   }
 
   mozilla::gfx::CompositionOp UsedOperation()
   {
     if (NeedToDrawShadow()) {
       // In this case the shadow rendering will use the operator.
       return mozilla::gfx::CompositionOp::OP_OVER;
     }
--- a/dom/events/EventStateManager.cpp
+++ b/dom/events/EventStateManager.cpp
@@ -1590,19 +1590,18 @@ EventStateManager::GenerateDragGesture(n
         pixelThresholdX = 5;
       if (!pixelThresholdY)
         pixelThresholdY = 5;
     }
 
     // fire drag gesture if mouse has moved enough
     LayoutDeviceIntPoint pt = aEvent->refPoint +
       LayoutDeviceIntPoint::FromUntyped(aEvent->widget->WidgetToScreenOffset());
-    LayoutDeviceIntPoint distance = pt - mGestureDownPoint;
-    if (Abs(distance.x.value) > SafeCast<uint32_t>(pixelThresholdX) ||
-        Abs(distance.y.value) > SafeCast<uint32_t>(pixelThresholdY)) {
+    if (DeprecatedAbs(pt.x - mGestureDownPoint.x) > pixelThresholdX ||
+        DeprecatedAbs(pt.y - mGestureDownPoint.y) > pixelThresholdY) {
       if (Prefs::ClickHoldContextMenu()) {
         // stop the click-hold before we fire off the drag gesture, in case
         // it takes a long time
         KillClickHoldTimer();
       }
 
       nsCOMPtr<nsISupports> container = aPresContext->GetContainerWeak();
       nsCOMPtr<nsPIDOMWindow> window = do_GetInterface(container);
deleted file mode 100644
--- a/gfx/2d/BaseCoord.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef MOZILLA_GFX_BASECOORD_H_
-#define MOZILLA_GFX_BASECOORD_H_
-
-#include "mozilla/Attributes.h"
-
-namespace mozilla {
-namespace gfx {
-
-/**
- * Do not use this class directly. Subclass it, pass that subclass as the
- * Sub parameter, and only use that subclass. This allows methods to safely
- * cast 'this' to 'Sub*'.
- */
-template <class T, class Sub>
-struct BaseCoord {
-  T value;
-
-  // Constructors
-  MOZ_CONSTEXPR BaseCoord() : value(0) {}
-  explicit MOZ_CONSTEXPR BaseCoord(T aValue) : value(aValue) {}
-
-  // Note that '=' isn't defined so we'll get the
-  // compiler generated default assignment operator
-
-  operator T() const { return value; }
-
-  friend bool operator==(Sub aA, Sub aB) {
-    return aA.value == aB.value;
-  }
-  friend bool operator!=(Sub aA, Sub aB) {
-    return aA.value != aB.value;
-  }
-
-  friend Sub operator+(Sub aA, Sub aB) {
-    return Sub(aA.value + aB.value);
-  }
-  friend Sub operator-(Sub aA, Sub aB) {
-    return Sub(aA.value - aB.value);
-  }
-  friend Sub operator*(Sub aCoord, T aScale) {
-    return Sub(aCoord.value * aScale);
-  }
-  friend Sub operator*(T aScale, Sub aCoord) {
-    return Sub(aScale * aCoord.value);
-  }
-  friend Sub operator/(Sub aCoord, T aScale) {
-    return Sub(aCoord.value / aScale);
-  }
-  // 'scale / coord' is intentionally omitted because it doesn't make sense.
-
-  Sub& operator+=(Sub aCoord) {
-    value += aCoord.value;
-    return *static_cast<Sub*>(this);
-  }
-  Sub& operator-=(Sub aCoord) {
-    value -= aCoord.value;
-    return *static_cast<Sub*>(this);
-  }
-  Sub& operator*=(T aScale) {
-    value *= aScale;
-    return *static_cast<Sub*>(this);
-  }
-  Sub& operator/=(T aScale) {
-    value /= aScale;
-    return *static_cast<Sub*>(this);
-  }
-
-  // Since BaseCoord is implicitly convertible to its value type T, we need
-  // mixed-type operator overloads to avoid ambiguities at mixed-type call
-  // sites. As we transition more of our code to strongly-typed classes, we
-  // may be able to remove some or all of these overloads.
-  friend bool operator==(Sub aA, T aB) {
-    return aA.value == aB;
-  }
-  friend bool operator==(T aA, Sub aB) {
-    return aA == aB.value;
-  }
-  friend bool operator!=(Sub aA, T aB) {
-    return aA.value != aB;
-  }
-  friend bool operator!=(T aA, Sub aB) {
-    return aA != aB.value;
-  }
-  friend T operator+(Sub aA, T aB) {
-    return aA.value + aB;
-  }
-  friend T operator+(T aA, Sub aB) {
-    return aA + aB.value;
-  }
-  friend T operator-(Sub aA, T aB) {
-    return aA.value - aB;
-  }
-  friend T operator-(T aA, Sub aB) {
-    return aA - aB.value;
-  }
-
-  Sub operator-() const {
-    return Sub(-value);
-  }
-};
-
-}
-}
-
-#endif /* MOZILLA_GFX_BASECOORD_H_ */
--- a/gfx/2d/BasePoint.h
+++ b/gfx/2d/BasePoint.h
@@ -12,23 +12,23 @@
 namespace mozilla {
 namespace gfx {
 
 /**
  * Do not use this class directly. Subclass it, pass that subclass as the
  * Sub parameter, and only use that subclass. This allows methods to safely
  * cast 'this' to 'Sub*'.
  */
-template <class T, class Sub, class Coord = T>
+template <class T, class Sub>
 struct BasePoint {
-  Coord x, y;
+  T x, y;
 
   // Constructors
   MOZ_CONSTEXPR BasePoint() : x(0), y(0) {}
-  MOZ_CONSTEXPR BasePoint(Coord aX, Coord aY) : x(aX), y(aY) {}
+  MOZ_CONSTEXPR BasePoint(T aX, T aY) : x(aX), y(aY) {}
 
   void MoveTo(T aX, T aY) { x = aX; y = aY; }
   void MoveBy(T aDx, T aDy) { x += aDx; y += aDy; }
 
   // Note that '=' isn't defined so we'll get the
   // compiler generated default assignment operator
 
   bool operator==(const Sub& aPoint) const {
@@ -62,25 +62,25 @@ struct BasePoint {
     return Sub(x / aScale, y / aScale);
   }
 
   Sub operator-() const {
     return Sub(-x, -y);
   }
 
   T Length() const {
-    return hypot(x.value, y.value);
+    return hypot(x, y);
   }
 
   // Round() is *not* rounding to nearest integer if the values are negative.
   // They are always rounding as floor(n + 0.5).
   // See https://bugzilla.mozilla.org/show_bug.cgi?id=410748#c14
   Sub& Round() {
-    x = Coord(floor(T(x) + T(0.5)));
-    y = Coord(floor(T(y) + T(0.5)));
+    x = static_cast<T>(floor(x + 0.5));
+    y = static_cast<T>(floor(y + 0.5));
     return *static_cast<Sub*>(this);
   }
 
 };
 
 }
 }
 
--- a/gfx/2d/Blur.cpp
+++ b/gfx/2d/Blur.cpp
@@ -729,16 +729,16 @@ AlphaBoxBlur::BoxBlur_C(uint8_t* aData,
  *   http://www.w3.org/TR/SVG11/filters.html#feGaussianBlurElement
  *   https://bugzilla.mozilla.org/show_bug.cgi?id=590039#c19
  */
 static const Float GAUSSIAN_SCALE_FACTOR = Float((3 * sqrt(2 * M_PI) / 4) * 1.5);
 
 IntSize
 AlphaBoxBlur::CalculateBlurRadius(const Point& aStd)
 {
-    IntSize size(static_cast<int32_t>(floor(aStd.x * GAUSSIAN_SCALE_FACTOR + 0.5f)),
-                 static_cast<int32_t>(floor(aStd.y * GAUSSIAN_SCALE_FACTOR + 0.5f)));
+    IntSize size(static_cast<int32_t>(floor(aStd.x * GAUSSIAN_SCALE_FACTOR + 0.5)),
+                 static_cast<int32_t>(floor(aStd.y * GAUSSIAN_SCALE_FACTOR + 0.5)));
 
     return size;
 }
 
 }
 }
deleted file mode 100644
--- a/gfx/2d/Coord.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef MOZILLA_GFX_COORD_H_
-#define MOZILLA_GFX_COORD_H_
-
-#include "mozilla/Attributes.h"
-#include "Types.h"
-#include "BaseCoord.h"
-
-#include <cmath>
-
-namespace mozilla {
-
-template <typename> struct IsPixel;
-
-namespace gfx {
-
-// This is a base class that provides mixed-type operator overloads between
-// a strongly-typed Coord and a primitive value. It is needed to avoid
-// ambiguities at mixed-type call sites, because Coord classes are implicitly
-// convertible to their underlying value type. As we transition more of our code
-// to strongly-typed classes, we may be able to remove some or all of these
-// overloads.
-template <class coord, class primitive>
-struct CoordOperatorsHelper {
-  friend bool operator==(coord aA, primitive aB) {
-    return aA.value == aB;
-  }
-  friend bool operator==(primitive aA, coord aB) {
-    return aA == aB.value;
-  }
-  friend bool operator!=(coord aA, primitive aB) {
-    return aA.value != aB;
-  }
-  friend bool operator!=(primitive aA, coord aB) {
-    return aA != aB.value;
-  }
-  friend primitive operator+(coord aA, primitive aB) {
-    return aA.value + aB;
-  }
-  friend primitive operator+(primitive aA, coord aB) {
-    return aA + aB.value;
-  }
-  friend primitive operator-(coord aA, primitive aB) {
-    return aA.value - aB;
-  }
-  friend primitive operator-(primitive aA, coord aB) {
-    return aA - aB.value;
-  }
-  friend primitive operator*(coord aCoord, primitive aScale) {
-    return aCoord.value * aScale;
-  }
-  friend primitive operator*(primitive aScale, coord aCoord) {
-    return aScale * aCoord.value;
-  }
-  friend primitive operator/(coord aCoord, primitive aScale) {
-    return aCoord.value / aScale;
-  }
-  // 'scale / coord' is intentionally omitted because it doesn't make sense.
-};
-
-// Note: 'IntCoordTyped<units>' and 'CoordTyped<units>' do not derive from
-// 'units' to work around https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61959.
-
-template<class units>
-struct IntCoordTyped :
-  public BaseCoord< int32_t, IntCoordTyped<units> >,
-  public CoordOperatorsHelper< IntCoordTyped<units>, float >,
-  public CoordOperatorsHelper< IntCoordTyped<units>, double > {
-  static_assert(IsPixel<units>::value,
-                "'units' must be a coordinate system tag");
-
-  typedef BaseCoord< int32_t, IntCoordTyped<units> > Super;
-
-  MOZ_CONSTEXPR IntCoordTyped() : Super() {}
-  MOZ_CONSTEXPR IntCoordTyped(int32_t aValue) : Super(aValue) {}
-};
-
-template<class units>
-struct CoordTyped :
-  public BaseCoord< Float, CoordTyped<units> >,
-  public CoordOperatorsHelper< CoordTyped<units>, int32_t >,
-  public CoordOperatorsHelper< CoordTyped<units>, uint32_t >,
-  public CoordOperatorsHelper< CoordTyped<units>, double > {
-  static_assert(IsPixel<units>::value,
-                "'units' must be a coordinate system tag");
-
-  typedef BaseCoord< Float, CoordTyped<units> > Super;
-
-  MOZ_CONSTEXPR CoordTyped() : Super() {}
-  MOZ_CONSTEXPR CoordTyped(Float aValue) : Super(aValue) {}
-  explicit MOZ_CONSTEXPR CoordTyped(const IntCoordTyped<units>& aCoord) : Super(float(aCoord.value)) {}
-
-  void Round() {
-    this->value = floor(this->value + 0.5);
-  }
-  void Truncate() {
-    this->value = int32_t(this->value);
-  }
-
-  IntCoordTyped<units> Rounded() const {
-    return IntCoordTyped<units>(int32_t(floor(this->value + 0.5)));
-  }
-  IntCoordTyped<units> Truncated() const {
-    return IntCoordTyped<units>(int32_t(this->value));
-  }
-};
-
-}
-}
-
-#endif /* MOZILLA_GFX_COORD_H_ */
--- a/gfx/2d/DrawTargetD2D.cpp
+++ b/gfx/2d/DrawTargetD2D.cpp
@@ -2594,17 +2594,17 @@ DrawTargetD2D::SetupEffectForRadialGradi
   float matrix[] = { invTransform._11, invTransform._12, 0, 0,
                       invTransform._21, invTransform._22, 0, 0,
                       invTransform._31, invTransform._32, 1.0f, 0,
                       0, 0, 0, 1.0f };
 
   mPrivateData->mEffect->GetVariableByName("DeviceSpaceToUserSpace")->
     AsMatrix()->SetMatrix(matrix);
 
-  float A = dc.x.value * dc.x.value + dc.y.value * dc.y.value - dr * dr;
+  float A = dc.x * dc.x + dc.y * dc.y - dr * dr;
 
   uint32_t offset = 0;
   switch (stops->mStopCollection->GetExtendMode()) {
   case D2D1_EXTEND_MODE_WRAP:
     offset = 1;
     break;
   case D2D1_EXTEND_MODE_MIRROR:
     offset = 2;
--- a/gfx/2d/DrawTargetTiled.cpp
+++ b/gfx/2d/DrawTargetTiled.cpp
@@ -30,18 +30,18 @@ DrawTargetTiled::Init(const TileSet& aTi
     if (mTiles[0].mDrawTarget->GetFormat() != mTiles.back().mDrawTarget->GetFormat() ||
         mTiles[0].mDrawTarget->GetBackendType() != mTiles.back().mDrawTarget->GetBackendType()) {
       return false;
     }
     uint32_t newXMost = max(mRect.XMost(),
                             mTiles[i].mTileOrigin.x + mTiles[i].mDrawTarget->GetSize().width);
     uint32_t newYMost = max(mRect.YMost(),
                             mTiles[i].mTileOrigin.y + mTiles[i].mDrawTarget->GetSize().height);
-    mRect.x = min(mRect.x, mTiles[i].mTileOrigin.x.value);
-    mRect.y = min(mRect.y, mTiles[i].mTileOrigin.y.value);
+    mRect.x = min(mRect.x, mTiles[i].mTileOrigin.x);
+    mRect.y = min(mRect.y, mTiles[i].mTileOrigin.y);
     mRect.width = newXMost - mRect.x;
     mRect.height = newYMost - mRect.y;
   }
   return true;
 }
 
 class SnapshotTiled : public SourceSurface
 {
--- a/gfx/2d/HelpersD2D.h
+++ b/gfx/2d/HelpersD2D.h
@@ -234,17 +234,17 @@ static inline bool IsPatternSupportedByD
     static_cast<const RadialGradientPattern*>(&aPattern);
   
   if (pat->mRadius1 != 0) {
     return false;
   }
 
   Point diff = pat->mCenter2 - pat->mCenter1;
 
-  if (sqrt(diff.x.value * diff.x.value + diff.y.value * diff.y.value) >= pat->mRadius2) {
+  if (sqrt(diff.x * diff.x + diff.y * diff.y) >= pat->mRadius2) {
     // Inner point lies outside the circle.
     return false;
   }
 
   return true;
 }
 
 /**
--- a/gfx/2d/Path.cpp
+++ b/gfx/2d/Path.cpp
@@ -102,17 +102,17 @@ FlattenedPath::BezierTo(const Point &aCP
   FlattenBezier(BezierControlPoints(CurrentPoint(), aCP1, aCP2, aCP3), this, kFlatteningTolerance);
 }
 
 void
 FlattenedPath::QuadraticBezierTo(const Point &aCP1,
                                  const Point &aCP2)
 {
   MOZ_ASSERT(!mCalculatedLength);
-  // We need to elevate the degree of this quadratic B�zier to cubic, so we're
+  // We need to elevate the degree of this quadratic Bézier to cubic, so we're
   // going to add an intermediate control point, and recompute control point 1.
   // The first and last control points remain the same.
   // This formula can be found on http://fontforge.sourceforge.net/bezier.html
   Point CP0 = CurrentPoint();
   Point CP1 = (CP0 + aCP1 * 2.0) / 3.0;
   Point CP2 = (aCP2 + aCP1 * 2.0) / 3.0;
   Point CP3 = aCP2;
 
@@ -245,17 +245,17 @@ FlattenBezierCurveSegment(const BezierCo
    */
   BezierControlPoints currentCP = aControlPoints;
 
   Float t = 0;
   while (t < 1.0f) {
     Point cp21 = currentCP.mCP2 - currentCP.mCP3;
     Point cp31 = currentCP.mCP3 - currentCP.mCP1;
 
-    Float s3 = (cp31.x.value * cp21.y.value - cp31.y.value * cp21.x.value) / hypotf(cp21.x, cp21.y);
+    Float s3 = (cp31.x * cp21.y - cp31.y * cp21.x) / hypotf(cp21.x, cp21.y);
 
     t = 2 * Float(sqrt(aTolerance / (3. * abs(s3))));
 
     if (t >= 1.0f) {
       aSink->LineTo(aControlPoints.mCP4);
       break;
     }
 
@@ -271,27 +271,27 @@ FindInflectionApproximationRange(BezierC
                                  Float *aMin, Float *aMax, Float aT,
                                  Float aTolerance)
 {
     SplitBezier(aControlPoints, nullptr, &aControlPoints, aT);
 
     Point cp21 = aControlPoints.mCP2 - aControlPoints.mCP1;
     Point cp41 = aControlPoints.mCP4 - aControlPoints.mCP1;
 
-    if (cp21.x == 0.f && cp21.y == 0.f) {
+    if (cp21.x == 0 && cp21.y == 0) {
       // In this case s3 becomes lim[n->0] (cp41.x * n) / n - (cp41.y * n) / n = cp41.x - cp41.y.
 
       // Use the absolute value so that Min and Max will correspond with the
       // minimum and maximum of the range.
       *aMin = aT - CubicRoot(abs(aTolerance / (cp41.x - cp41.y)));
       *aMax = aT + CubicRoot(abs(aTolerance / (cp41.x - cp41.y)));
       return;
     }
 
-    Float s3 = (cp41.x.value * cp21.y.value - cp41.y.value * cp21.x.value) / hypotf(cp21.x, cp21.y);
+    Float s3 = (cp41.x * cp21.y - cp41.y * cp21.x) / hypotf(cp21.x, cp21.y);
 
     if (s3 == 0) {
       // This means within the precision we have it can be approximated
       // infinitely by a linear segment. Deal with this by specifying the
       // approximation range as extending beyond the entire curve.
       *aMin = -1.0f;
       *aMax = 2.0f;
       return;
--- a/gfx/2d/PathHelpers.h
+++ b/gfx/2d/PathHelpers.h
@@ -11,18 +11,18 @@
 
 namespace mozilla {
 namespace gfx {
 
 template <typename T>
 void ArcToBezier(T* aSink, const Point &aOrigin, const Size &aRadius,
                  float aStartAngle, float aEndAngle, bool aAntiClockwise)
 {
-  Point startPoint(aOrigin.x + cosf(aStartAngle) * aRadius.width,
-                   aOrigin.y + sinf(aStartAngle) * aRadius.height);
+  Point startPoint(aOrigin.x + cos(aStartAngle) * aRadius.width,
+                   aOrigin.y + sin(aStartAngle) * aRadius.height);
 
   aSink->LineTo(startPoint);
 
   // Clockwise we always sweep from the smaller to the larger angle, ccw
   // it's vice versa.
   if (!aAntiClockwise && (aEndAngle < aStartAngle)) {
     Float correction = Float(ceil((aStartAngle - aEndAngle) / (2.0f * M_PI)));
     aEndAngle += float(correction * 2.0f * M_PI);
@@ -51,20 +51,20 @@ void ArcToBezier(T* aSink, const Point &
     Float currentEndAngle;
 
     if (arcSweepLeft > M_PI / 2.0f) {
       currentEndAngle = Float(currentStartAngle + M_PI / 2.0f * sweepDirection);
     } else {
       currentEndAngle = currentStartAngle + arcSweepLeft * sweepDirection;
     }
 
-    Point currentStartPoint(aOrigin.x + cosf(currentStartAngle) * aRadius.width,
-                            aOrigin.y + sinf(currentStartAngle) * aRadius.height);
-    Point currentEndPoint(aOrigin.x + cosf(currentEndAngle) * aRadius.width,
-                          aOrigin.y + sinf(currentEndAngle) * aRadius.height);
+    Point currentStartPoint(aOrigin.x + cos(currentStartAngle) * aRadius.width,
+                            aOrigin.y + sin(currentStartAngle) * aRadius.height);
+    Point currentEndPoint(aOrigin.x + cos(currentEndAngle) * aRadius.width,
+                          aOrigin.y + sin(currentEndAngle) * aRadius.height);
 
     // Calculate kappa constant for partial curve. The sign of angle in the
     // tangent will actually ensure this is negative for a counter clockwise
     // sweep, so changing signs later isn't needed.
     Float kappaFactor = (4.0f / 3.0f) * tan((currentEndAngle - currentStartAngle) / 4.0f);
     Float kappaX = kappaFactor * aRadius.width;
     Float kappaY = kappaFactor * aRadius.height;
 
--- a/gfx/2d/PathSkia.cpp
+++ b/gfx/2d/PathSkia.cpp
@@ -136,20 +136,20 @@ PathSkia::ContainsPoint(const Point &aPo
   Rect bounds = GetBounds(aTransform);
 
   if (aPoint.x < bounds.x || aPoint.y < bounds.y ||
       aPoint.x > bounds.XMost() || aPoint.y > bounds.YMost()) {
     return false;
   }
 
   SkRegion pointRect;
-  pointRect.setRect(int32_t(SkFloatToScalar(transformed.x - 1.f)),
-                    int32_t(SkFloatToScalar(transformed.y - 1.f)),
-                    int32_t(SkFloatToScalar(transformed.x + 1.f)),
-                    int32_t(SkFloatToScalar(transformed.y + 1.f)));
+  pointRect.setRect(int32_t(SkFloatToScalar(transformed.x - 1)),
+                    int32_t(SkFloatToScalar(transformed.y - 1)),
+                    int32_t(SkFloatToScalar(transformed.x + 1)),
+                    int32_t(SkFloatToScalar(transformed.y + 1)));
 
   SkRegion pathRegion;
   
   return pathRegion.setPath(mPath, pointRect);
 }
 
 bool
 PathSkia::StrokeContainsPoint(const StrokeOptions &aStrokeOptions,
@@ -169,20 +169,20 @@ PathSkia::StrokeContainsPoint(const Stro
   Rect bounds = aTransform.TransformBounds(SkRectToRect(strokePath.getBounds()));
 
   if (aPoint.x < bounds.x || aPoint.y < bounds.y ||
       aPoint.x > bounds.XMost() || aPoint.y > bounds.YMost()) {
     return false;
   }
 
   SkRegion pointRect;
-  pointRect.setRect(int32_t(SkFloatToScalar(transformed.x - 1.f)),
-                    int32_t(SkFloatToScalar(transformed.y - 1.f)),
-                    int32_t(SkFloatToScalar(transformed.x + 1.f)),
-                    int32_t(SkFloatToScalar(transformed.y + 1.f)));
+  pointRect.setRect(int32_t(SkFloatToScalar(transformed.x - 1)),
+                    int32_t(SkFloatToScalar(transformed.y - 1)),
+                    int32_t(SkFloatToScalar(transformed.x + 1)),
+                    int32_t(SkFloatToScalar(transformed.y + 1)));
 
   SkRegion pathRegion;
   
   return pathRegion.setPath(strokePath, pointRect);
 }
 
 Rect
 PathSkia::GetBounds(const Matrix &aTransform) const
--- a/gfx/2d/Point.h
+++ b/gfx/2d/Point.h
@@ -3,18 +3,16 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef MOZILLA_GFX_POINT_H_
 #define MOZILLA_GFX_POINT_H_
 
 #include "mozilla/Attributes.h"
 #include "Types.h"
-#include "Coord.h"
-#include "BaseCoord.h"
 #include "BasePoint.h"
 #include "BasePoint3D.h"
 #include "BasePoint4D.h"
 #include "BaseSize.h"
 #include "mozilla/TypeTraits.h"
 
 #include <cmath>
 
@@ -30,62 +28,50 @@ struct UnknownUnits {};
 }  // close namespace 'gfx' because IsPixel specialization must be in 'mozilla'
 
 template<> struct IsPixel<gfx::UnknownUnits> : TrueType {};
 
 namespace gfx {
 
 template<class units>
 struct IntPointTyped :
-  public BasePoint< int32_t, IntPointTyped<units>, IntCoordTyped<units> >,
+  public BasePoint< int32_t, IntPointTyped<units> >,
   public units {
   static_assert(IsPixel<units>::value,
                 "'units' must be a coordinate system tag");
 
-  typedef IntCoordTyped<units> Coord;
-  typedef BasePoint< int32_t, IntPointTyped<units>, IntCoordTyped<units> > Super;
+  typedef BasePoint< int32_t, IntPointTyped<units> > Super;
 
   MOZ_CONSTEXPR IntPointTyped() : Super() {}
-  MOZ_CONSTEXPR IntPointTyped(int32_t aX, int32_t aY) : Super(Coord(aX), Coord(aY)) {}
-  // The mixed-type constructors (int, Coord) and (Coord, int) are needed to
-  // avoid ambiguities because Coord is implicitly convertible to int.
-  MOZ_CONSTEXPR IntPointTyped(int32_t aX, Coord aY) : Super(Coord(aX), aY) {}
-  MOZ_CONSTEXPR IntPointTyped(Coord aX, int32_t aY) : Super(aX, Coord(aY)) {}
-  MOZ_CONSTEXPR IntPointTyped(Coord aX, Coord aY) : Super(aX, aY) {}
+  MOZ_CONSTEXPR IntPointTyped(int32_t aX, int32_t aY) : Super(aX, aY) {}
 
   // XXX When all of the code is ported, the following functions to convert to and from
   // unknown types should be removed.
 
   static IntPointTyped<units> FromUnknownPoint(const IntPointTyped<UnknownUnits>& aPoint) {
     return IntPointTyped<units>(aPoint.x, aPoint.y);
   }
 
   IntPointTyped<UnknownUnits> ToUnknownPoint() const {
     return IntPointTyped<UnknownUnits>(this->x, this->y);
   }
 };
 typedef IntPointTyped<UnknownUnits> IntPoint;
 
 template<class units>
 struct PointTyped :
-  public BasePoint< Float, PointTyped<units>, CoordTyped<units> >,
+  public BasePoint< Float, PointTyped<units> >,
   public units {
   static_assert(IsPixel<units>::value,
                 "'units' must be a coordinate system tag");
 
-  typedef CoordTyped<units> Coord;
-  typedef BasePoint< Float, PointTyped<units>, CoordTyped<units> > Super;
+  typedef BasePoint< Float, PointTyped<units> > Super;
 
   MOZ_CONSTEXPR PointTyped() : Super() {}
-  MOZ_CONSTEXPR PointTyped(Float aX, Float aY) : Super(Coord(aX), Coord(aY)) {}
-  // The mixed-type constructors (Float, Coord) and (Coord, Float) are needed to
-  // avoid ambiguities because Coord is implicitly convertible to Float.
-  MOZ_CONSTEXPR PointTyped(Float aX, Coord aY) : Super(Coord(aX), aY) {}
-  MOZ_CONSTEXPR PointTyped(Coord aX, Float aY) : Super(aX, Coord(aY)) {}
-  MOZ_CONSTEXPR PointTyped(Coord aX, Coord aY) : Super(aX.value, aY.value) {}
+  MOZ_CONSTEXPR PointTyped(Float aX, Float aY) : Super(aX, aY) {}
   MOZ_CONSTEXPR MOZ_IMPLICIT PointTyped(const IntPointTyped<units>& point) : Super(float(point.x), float(point.y)) {}
 
   // XXX When all of the code is ported, the following functions to convert to and from
   // unknown types should be removed.
 
   static PointTyped<units> FromUnknownPoint(const PointTyped<UnknownUnits>& aPoint) {
     return PointTyped<units>(aPoint.x, aPoint.y);
   }
@@ -93,24 +79,18 @@ struct PointTyped :
   PointTyped<UnknownUnits> ToUnknownPoint() const {
     return PointTyped<UnknownUnits>(this->x, this->y);
   }
 };
 typedef PointTyped<UnknownUnits> Point;
 
 template<class units>
 IntPointTyped<units> RoundedToInt(const PointTyped<units>& aPoint) {
-  return IntPointTyped<units>(aPoint.x.Rounded(),
-                              aPoint.y.Rounded());
-}
-
-template<class units>
-IntPointTyped<units> TruncatedToInt(const PointTyped<units>& aPoint) {
-  return IntPointTyped<units>(aPoint.x.Truncated(),
-                              aPoint.y.Truncated());
+  return IntPointTyped<units>(int32_t(floorf(aPoint.x + 0.5f)),
+                              int32_t(floorf(aPoint.y + 0.5f)));
 }
 
 template<class units>
 struct Point3DTyped :
   public BasePoint3D< Float, Point3DTyped<units> > {
   static_assert(IsPixel<units>::value,
                 "'units' must be a coordinate system tag");
 
--- a/gfx/2d/SVGTurbulenceRenderer-inl.h
+++ b/gfx/2d/SVGTurbulenceRenderer-inl.h
@@ -235,25 +235,25 @@ SVGTurbulenceRenderer<Type,Stitch,f32x4_
   Point r = aVec - topLeftLatticePoint; // fractional offset
 
   IntPoint b0 = AdjustForStitch(topLeftLatticePoint, aStitchInfo);
   IntPoint b1 = AdjustForStitch(b0 + IntPoint(1, 1), aStitchInfo);
 
   uint8_t i = mLatticeSelector[b0.x & sBM];
   uint8_t j = mLatticeSelector[b1.x & sBM];
 
-  const f32x4_t* qua = mGradient[(i + b0.y.value) & sBM];
-  const f32x4_t* qub = mGradient[(i + b1.y.value) & sBM];
-  const f32x4_t* qva = mGradient[(j + b0.y.value) & sBM];
-  const f32x4_t* qvb = mGradient[(j + b1.y.value) & sBM];
+  const f32x4_t* qua = mGradient[(i + b0.y) & sBM];
+  const f32x4_t* qub = mGradient[(i + b1.y) & sBM];
+  const f32x4_t* qva = mGradient[(j + b0.y) & sBM];
+  const f32x4_t* qvb = mGradient[(j + b1.y) & sBM];
 
   return BiMix(simd::WSumF32(qua[0], qua[1], r.x, r.y),
-               simd::WSumF32(qva[0], qva[1], r.x - 1.f, r.y),
-               simd::WSumF32(qub[0], qub[1], r.x, r.y - 1.f),
-               simd::WSumF32(qvb[0], qvb[1], r.x - 1.f, r.y - 1.f),
+               simd::WSumF32(qva[0], qva[1], r.x - 1, r.y),
+               simd::WSumF32(qub[0], qub[1], r.x, r.y - 1),
+               simd::WSumF32(qvb[0], qvb[1], r.x - 1, r.y - 1),
                SCurve(r));
 }
 
 template<typename f32x4_t, typename i32x4_t, typename u8x16_t>
 static inline i32x4_t
 ColorToBGRA(f32x4_t aUnscaledUnpreFloat)
 {
   // Color is an unpremultiplied float vector where 1.0f means white. We will
--- a/gfx/2d/moz.build
+++ b/gfx/2d/moz.build
@@ -5,26 +5,24 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 EXPORTS.mozilla += [
     'GenericRefCounted.h',
 ]
 
 EXPORTS.mozilla.gfx += [
     '2D.h',
-    'BaseCoord.h',
     'BaseMargin.h',
     'BasePoint.h',
     'BasePoint3D.h',
     'BasePoint4D.h',
     'BaseRect.h',
     'BaseSize.h',
     'Blur.h',
     'BorrowedContext.h',
-    'Coord.h',
     'DataSurfaceHelpers.h',
     'Filters.h',
     'Helpers.h',
     'Logging.h',
     'Matrix.h',
     'PathHelpers.h',
     'Point.h',
     'Rect.h',
--- a/gfx/2d/unittest/TestPoint.cpp
+++ b/gfx/2d/unittest/TestPoint.cpp
@@ -21,26 +21,26 @@ TestPoint::Addition()
   Point a, b;
   a.x = 2;
   a.y = 2;
   b.x = 5;
   b.y = -5;
 
   a += b;
 
-  VERIFY(a.x == 7.f);
-  VERIFY(a.y == -3.f);
+  VERIFY(a.x == 7);
+  VERIFY(a.y == -3);
 }
 
 void
 TestPoint::Subtraction()
 {
   Point a, b;
   a.x = 2;
   a.y = 2;
   b.x = 5;
   b.y = -5;
 
   a -= b;
 
-  VERIFY(a.x == -3.f);
-  VERIFY(a.y == 7.f);
+  VERIFY(a.x == -3);
+  VERIFY(a.y == 7);
 }
--- a/gfx/ipc/GfxMessageUtils.h
+++ b/gfx/ipc/GfxMessageUtils.h
@@ -502,48 +502,16 @@ struct ParamTraits<nsIntSize>
 
   static bool Read(const Message* msg, void** iter, paramType* result)
   {
     return (ReadParam(msg, iter, &result->width) &&
             ReadParam(msg, iter, &result->height));
   }
 };
 
-template<class T>
-struct ParamTraits< mozilla::gfx::CoordTyped<T> >
-{
-  typedef mozilla::gfx::CoordTyped<T> paramType;
-
-  static void Write(Message* msg, const paramType& param)
-  {
-    WriteParam(msg, param.value);
-  }
-
-  static bool Read(const Message* msg, void** iter, paramType* result)
-  {
-    return (ReadParam(msg, iter, &result->value));
-  }
-};
-
-template<class T>
-struct ParamTraits< mozilla::gfx::IntCoordTyped<T> >
-{
-  typedef mozilla::gfx::IntCoordTyped<T> paramType;
-
-  static void Write(Message* msg, const paramType& param)
-  {
-    WriteParam(msg, param.value);
-  }
-
-  static bool Read(const Message* msg, void** iter, paramType* result)
-  {
-    return (ReadParam(msg, iter, &result->value));
-  }
-};
-
 template<class T, class U>
 struct ParamTraits< mozilla::gfx::ScaleFactor<T, U> >
 {
   typedef mozilla::gfx::ScaleFactor<T, U> paramType;
 
   static void Write(Message* msg, const paramType& param)
   {
     WriteParam(msg, param.scale);
--- a/gfx/layers/apz/src/APZCTreeManager.cpp
+++ b/gfx/layers/apz/src/APZCTreeManager.cpp
@@ -379,24 +379,26 @@ APZCTreeManager::UpdatePanZoomController
   }
   return aNextSibling;
 }
 
 /*static*/ template<class T> void
 ApplyTransform(gfx::PointTyped<T>* aPoint, const Matrix4x4& aMatrix)
 {
   Point result = aMatrix * aPoint->ToUnknownPoint();
-  *aPoint = ViewAs<T>(result);
+  aPoint->x = result.x;
+  aPoint->y = result.y;
 }
 
 /*static*/ template<class T> void
 ApplyTransform(gfx::IntPointTyped<T>* aPoint, const Matrix4x4& aMatrix)
 {
   Point result = aMatrix * aPoint->ToUnknownPoint();
-  *aPoint = TruncatedToInt(ViewAs<T>(result));
+  aPoint->x = result.x;
+  aPoint->y = result.y;
 }
 
 /*static*/ void
 ApplyTransform(nsIntPoint* aPoint, const Matrix4x4& aMatrix)
 {
   Point result = aMatrix * Point(aPoint->x, aPoint->y);
   aPoint->x = NS_lround(result.x);
   aPoint->y = NS_lround(result.y);
@@ -644,17 +646,19 @@ APZCTreeManager::TransformCoordinateToGe
 {
   MOZ_ASSERT(aOutTransformedPoint);
   nsRefPtr<AsyncPanZoomController> apzc = GetTargetAPZC(aPoint, nullptr);
   if (apzc && aOutTransformedPoint) {
     Matrix4x4 transformToApzc;
     Matrix4x4 transformToGecko;
     GetInputTransforms(apzc, transformToApzc, transformToGecko);
     Matrix4x4 outTransform = transformToApzc * transformToGecko;
-    *aOutTransformedPoint = TransformTo<LayoutDevicePixel>(outTransform, aPoint);
+    aOutTransformedPoint->x = aPoint.x;
+    aOutTransformedPoint->y = aPoint.y;
+    ApplyTransform(aOutTransformedPoint, outTransform);
   }
 }
 
 nsEventStatus
 APZCTreeManager::ProcessEvent(WidgetInputEvent& aEvent,
                               ScrollableLayerGuid* aOutTargetGuid)
 {
   MOZ_ASSERT(NS_IsMainThread());
--- a/gfx/layers/apz/src/AsyncPanZoomController.cpp
+++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp
@@ -373,18 +373,18 @@ static bool IsCloseToHorizontal(float aA
 static bool IsCloseToVertical(float aAngle, float aThreshold)
 {
   return (fabs(aAngle - (M_PI / 2)) < aThreshold);
 }
 
 template <typename Units>
 static bool IsZero(const gfx::PointTyped<Units>& aPoint)
 {
-  return FuzzyEqualsMultiplicative(aPoint.x.value, 0.0f)
-      && FuzzyEqualsMultiplicative(aPoint.y.value, 0.0f);
+  return FuzzyEqualsMultiplicative(aPoint.x, 0.0f)
+      && FuzzyEqualsMultiplicative(aPoint.y, 0.0f);
 }
 
 static inline void LogRendertraceRect(const ScrollableLayerGuid& aGuid, const char* aDesc, const char* aColor, const CSSRect& aRect)
 {
 #ifdef APZC_ENABLE_RENDERTRACE
   static const TimeStamp sRenderStart = TimeStamp::Now();
   TimeDuration delta = TimeStamp::Now() - sRenderStart;
   printf_stderr("(%llu,%lu,%llu)%s RENDERTRACE %f rect %s %f %f %f %f\n",
@@ -524,19 +524,19 @@ public:
 
       } else {
         // Otherwise, hand off the fling to the next APZC in the overscroll
         // handoff chain.
 
         // We may have reached the end of the scroll range along one axis but
         // not the other. In such a case we only want to hand off the relevant
         // component of the fling.
-        if (FuzzyEqualsAdditive(overscroll.x.value, 0.0f, COORDINATE_EPSILON)) {
+        if (FuzzyEqualsAdditive(overscroll.x, 0.0f, COORDINATE_EPSILON)) {
           velocity.x = 0;
-        } else if (FuzzyEqualsAdditive(overscroll.y.value, 0.0f, COORDINATE_EPSILON)) {
+        } else if (FuzzyEqualsAdditive(overscroll.y, 0.0f, COORDINATE_EPSILON)) {
           velocity.y = 0;
         }
 
         // To hand off the fling, we attempt to find a target APZC and start a new
         // fling with the same velocity on that APZC. For simplicity, the actual
         // overscroll of the current sample is discarded rather than being handed
         // off. The compositor should sample animations sufficiently frequently
         // that this is not noticeable. The target APZC is chosen by seeing if
@@ -594,17 +594,17 @@ public:
     if (animPosition >= 1.0) {
       aFrameMetrics.SetZoom(mEndZoom);
       aFrameMetrics.SetScrollOffset(mEndOffset);
       return false;
     }
 
     // Sample the zoom at the current time point.  The sampled zoom
     // will affect the final computed resolution.
-    float sampledPosition = gComputedTimingFunction->GetValue(animPosition);
+    double sampledPosition = gComputedTimingFunction->GetValue(animPosition);
 
     // We scale the scrollOffset linearly with sampledPosition, so the zoom
     // needs to scale inversely to match.
     aFrameMetrics.SetZoom(CSSToScreenScale(1 /
       (sampledPosition / mEndZoom.scale +
       (1 - sampledPosition) / mStartZoom.scale)));
 
     aFrameMetrics.SetScrollOffset(CSSPoint::FromUnknownPoint(gfx::Point(
@@ -1352,18 +1352,18 @@ AsyncPanZoomController::ConvertToGecko(c
     return true;
   }
   return false;
 }
 
 nsEventStatus AsyncPanZoomController::OnPanMayBegin(const PanGestureInput& aEvent) {
   APZC_LOG("%p got a pan-maybegin in state %d\n", this, mState);
 
-  mX.StartTouch(aEvent.mPanStartPoint.x.Truncated(), aEvent.mTime);
-  mY.StartTouch(aEvent.mPanStartPoint.y.Truncated(), aEvent.mTime);
+  mX.StartTouch(aEvent.mPanStartPoint.x, aEvent.mTime);
+  mY.StartTouch(aEvent.mPanStartPoint.y, aEvent.mTime);
   CancelAnimationForHandoffChain();
 
   return nsEventStatus_eConsumeNoDefault;
 }
 
 nsEventStatus AsyncPanZoomController::OnPanCancelled(const PanGestureInput& aEvent) {
   APZC_LOG("%p got a pan-cancelled in state %d\n", this, mState);
 
@@ -1372,18 +1372,18 @@ nsEventStatus AsyncPanZoomController::On
 
   return nsEventStatus_eConsumeNoDefault;
 }
 
 
 nsEventStatus AsyncPanZoomController::OnPanBegin(const PanGestureInput& aEvent) {
   APZC_LOG("%p got a pan-begin in state %d\n", this, mState);
 
-  mX.StartTouch(aEvent.mPanStartPoint.x.Truncated(), aEvent.mTime);
-  mY.StartTouch(aEvent.mPanStartPoint.y.Truncated(), aEvent.mTime);
+  mX.StartTouch(aEvent.mPanStartPoint.x, aEvent.mTime);
+  mY.StartTouch(aEvent.mPanStartPoint.y, aEvent.mTime);
 
   if (GetAxisLockMode() == FREE) {
     SetState(PANNING);
     return nsEventStatus_eConsumeNoDefault;
   }
 
   float dx = aEvent.mPanDisplacement.x, dy = aEvent.mPanDisplacement.y;
   double angle = atan2(dy, dx); // range [-pi, pi]
@@ -1396,18 +1396,18 @@ nsEventStatus AsyncPanZoomController::On
 
 nsEventStatus AsyncPanZoomController::OnPan(const PanGestureInput& aEvent, bool aFingersOnTouchpad) {
   APZC_LOG("%p got a pan-pan in state %d\n", this, mState);
 
   // We need to update the axis velocity in order to get a useful display port
   // size and position. We need to do so even if this is a momentum pan (i.e.
   // aFingersOnTouchpad == false); in that case the "with touch" part is not
   // really appropriate, so we may want to rethink this at some point.
-  mX.UpdateWithTouchAtDevicePoint(aEvent.mPanStartPoint.x.Truncated(), aEvent.mTime);
-  mY.UpdateWithTouchAtDevicePoint(aEvent.mPanStartPoint.y.Truncated(), aEvent.mTime);
+  mX.UpdateWithTouchAtDevicePoint(aEvent.mPanStartPoint.x, aEvent.mTime);
+  mY.UpdateWithTouchAtDevicePoint(aEvent.mPanStartPoint.y, aEvent.mTime);
 
   HandlePanningUpdate(aEvent.mPanDisplacement.x, aEvent.mPanDisplacement.y);
 
   CallDispatchScroll(aEvent.mPanStartPoint, aEvent.mPanStartPoint + aEvent.mPanDisplacement, 0);
 
   return nsEventStatus_eConsumeNoDefault;
 }
 
@@ -2901,17 +2901,17 @@ void AsyncPanZoomController::ShareCompos
         APZC_LOG("%p failed to share FrameMetrics with content process.", this);
       }
     }
   }
 }
 
 ParentLayerPoint AsyncPanZoomController::ToParentLayerCoords(const ScreenPoint& aPoint)
 {
-  return TransformTo<ParentLayerPixel>(GetNontransientAsyncTransform() * GetCSSTransform(), aPoint);
+  return TransformTo<ParentLayerPixel>(To3DMatrix(GetNontransientAsyncTransform() * GetCSSTransform()), aPoint);
 }
 
 void AsyncPanZoomController::UpdateTransformScale()
 {
   Matrix4x4 nontransientTransforms = GetNontransientAsyncTransform() * GetCSSTransform();
   if (!FuzzyEqualsMultiplicative(nontransientTransforms._11, nontransientTransforms._22)) {
     NS_WARNING("The x- and y-scales of the nontransient transforms should be equal");
   }
--- a/gfx/layers/apz/src/Axis.cpp
+++ b/gfx/layers/apz/src/Axis.cpp
@@ -28,17 +28,17 @@ Axis::Axis(AsyncPanZoomController* aAsyn
     mPosTimeMs(0),
     mVelocity(0.0f),
     mAxisLocked(false),
     mAsyncPanZoomController(aAsyncPanZoomController),
     mOverscroll(0)
 {
 }
 
-void Axis::UpdateWithTouchAtDevicePoint(ScreenIntCoord aPos, uint32_t aTimestampMs) {
+void Axis::UpdateWithTouchAtDevicePoint(int32_t aPos, uint32_t aTimestampMs) {
   // mVelocityQueue is controller-thread only
   AsyncPanZoomController::AssertOnControllerThread();
 
   if (aTimestampMs == mPosTimeMs) {
     // This could be a duplicate event, or it could be a legitimate event
     // on some platforms that generate events really fast. As a compromise
     // update mPos so we don't run into problems like bug 1042734, even though
     // that means the velocity will be stale. Better than doing a divide-by-zero.
@@ -57,41 +57,41 @@ void Axis::UpdateWithTouchAtDevicePoint(
 
   // Limit queue size pased on pref
   mVelocityQueue.AppendElement(std::make_pair(aTimestampMs, mVelocity));
   if (mVelocityQueue.Length() > gfxPrefs::APZMaxVelocityQueueSize()) {
     mVelocityQueue.RemoveElementAt(0);
   }
 }
 
-void Axis::StartTouch(ScreenIntCoord aPos, uint32_t aTimestampMs) {
+void Axis::StartTouch(int32_t aPos, uint32_t aTimestampMs) {
   mStartPos = aPos;
   mPos = aPos;
   mPosTimeMs = aTimestampMs;
   mAxisLocked = false;
 }
 
-bool Axis::AdjustDisplacement(CSSCoord aDisplacement,
-                              CSSCoord& aDisplacementOut,
-                              CSSCoord& aOverscrollAmountOut)
+bool Axis::AdjustDisplacement(float aDisplacement,
+                              float& aDisplacementOut,
+                              float& aOverscrollAmountOut)
 {
   if (mAxisLocked) {
     aOverscrollAmountOut = 0;
     aDisplacementOut = 0;
     return false;
   }
 
-  CSSCoord displacement = aDisplacement;
+  float displacement = aDisplacement;
 
   // First consume any overscroll in the opposite direction along this axis.
-  CSSCoord consumedOverscroll = 0;
+  float consumedOverscroll = 0;
   if (mOverscroll > 0 && aDisplacement < 0) {
     consumedOverscroll = std::min(mOverscroll, -aDisplacement);
   } else if (mOverscroll < 0 && aDisplacement > 0) {
-    consumedOverscroll = 0.f - std::min(-mOverscroll, aDisplacement);
+    consumedOverscroll = 0 - std::min(-mOverscroll, aDisplacement);
   }
   mOverscroll -= consumedOverscroll;
   displacement += consumedOverscroll;
 
   // Split the requested displacement into an allowed displacement that does
   // not overscroll, and an overscroll amount.
   if (DisplacementWillOverscroll(displacement) != OVERSCROLL_NONE) {
     // No need to have a velocity along this axis anymore; it won't take us
@@ -99,41 +99,41 @@ bool Axis::AdjustDisplacement(CSSCoord a
     mVelocity = 0.0f;
     aOverscrollAmountOut = DisplacementWillOverscrollAmount(displacement);
     displacement -= aOverscrollAmountOut;
   }
   aDisplacementOut = displacement;
   return fabsf(consumedOverscroll) > EPSILON;
 }
 
-CSSCoord Axis::ApplyResistance(CSSCoord aRequestedOverscroll) const {
+float Axis::ApplyResistance(float aRequestedOverscroll) const {
   // 'resistanceFactor' is a value between 0 and 1, which:
   //   - tends to 1 as the existing overscroll tends to 0
   //   - tends to 0 as the existing overscroll tends to the composition length
   // The actual overscroll is the requested overscroll multiplied by this
   // factor; this should prevent overscrolling by more than the composition
   // length.
   float resistanceFactor = 1 - fabsf(mOverscroll) / GetCompositionLength();
-  return resistanceFactor < 0 ? CSSCoord(0) : aRequestedOverscroll * resistanceFactor;
+  return resistanceFactor < 0 ? 0 : aRequestedOverscroll * resistanceFactor;
 }
 
-void Axis::OverscrollBy(CSSCoord aOverscroll) {
+void Axis::OverscrollBy(float aOverscroll) {
   MOZ_ASSERT(CanScroll());
   aOverscroll = ApplyResistance(aOverscroll);
   if (aOverscroll > 0) {
-    MOZ_ASSERT(FuzzyEqualsAdditive(GetCompositionEnd().value, GetPageEnd().value, COORDINATE_EPSILON));
+    MOZ_ASSERT(FuzzyEqualsAdditive(GetCompositionEnd(), GetPageEnd(), COORDINATE_EPSILON));
     MOZ_ASSERT(mOverscroll >= 0);
   } else if (aOverscroll < 0) {
-    MOZ_ASSERT(FuzzyEqualsAdditive(GetOrigin().value, GetPageStart().value, COORDINATE_EPSILON));
+    MOZ_ASSERT(FuzzyEqualsAdditive(GetOrigin(), GetPageStart(), COORDINATE_EPSILON));
     MOZ_ASSERT(mOverscroll <= 0);
   }
   mOverscroll += aOverscroll;
 }
 
-CSSCoord Axis::GetOverscroll() const {
+float Axis::GetOverscroll() const {
   return mOverscroll;
 }
 
 bool Axis::SampleSnapBack(const TimeDuration& aDelta) {
   // Apply spring physics to the snap-back as time goes on.
   // Note: this method of sampling isn't perfectly smooth, as it assumes
   // a constant velocity over 'aDelta', instead of an accelerating velocity.
   // (The way we applying friction to flings has the same issue.)
@@ -157,52 +157,52 @@ bool Axis::SampleSnapBack(const TimeDura
   float cssDisplacement = screenDisplacement / GetFrameMetrics().GetZoom().scale;
   if (mOverscroll > 0) {
     if (cssDisplacement > 0) {
       NS_WARNING("Overscroll snap-back animation is moving in the wrong direction!");
       return false;
     }
     mOverscroll = std::max(mOverscroll + cssDisplacement, 0.0f);
     // Overscroll relieved, do not continue animation.
-    if (mOverscroll == 0.f) {
+    if (mOverscroll == 0) {
       mVelocity = 0;
       return false;
     }
     return true;
   } else if (mOverscroll < 0) {
     if (cssDisplacement < 0) {
       NS_WARNING("Overscroll snap-back animation is moving in the wrong direction!");
       return false;
     }
     mOverscroll = std::min(mOverscroll + cssDisplacement, 0.0f);
     // Overscroll relieved, do not continue animation.
-    if (mOverscroll == 0.f) {
+    if (mOverscroll == 0) {
       mVelocity = 0;
       return false;
     }
     return true;
   }
   // No overscroll on this axis, do not continue animation.
   return false;
 }
 
 bool Axis::IsOverscrolled() const {
-  return mOverscroll != 0.f;
+  return mOverscroll != 0;
 }
 
 void Axis::ClearOverscroll() {
   mOverscroll = 0;
 }
 
 float Axis::PanDistance() {
-  return fabsf((mPos - mStartPos).value);
+  return fabsf(mPos - mStartPos);
 }
 
-float Axis::PanDistance(ScreenIntCoord aPos) {
-  return fabsf((aPos - mStartPos).value);
+float Axis::PanDistance(float aPos) {
+  return fabsf(aPos - mStartPos);
 }
 
 void Axis::EndTouch(uint32_t aTimestampMs) {
   // mVelocityQueue is controller-thread only
   AsyncPanZoomController::AssertOnControllerThread();
 
   mVelocity = 0;
   int count = 0;
@@ -247,17 +247,17 @@ bool Axis::FlingApplyFrictionOrCancel(co
     mVelocity = 0.0f;
     return false;
   } else {
     mVelocity *= pow(1.0f - aFriction, float(aDelta.ToMilliseconds()));
   }
   return true;
 }
 
-Axis::Overscroll Axis::DisplacementWillOverscroll(CSSCoord aDisplacement) {
+Axis::Overscroll Axis::DisplacementWillOverscroll(float aDisplacement) {
   // If the current pan plus a displacement takes the window to the left of or
   // above the current page rect.
   bool minus = GetOrigin() + aDisplacement < GetPageStart();
   // If the current pan plus a displacement takes the window to the right of or
   // below the current page rect.
   bool plus = GetCompositionEnd() + aDisplacement > GetPageEnd();
   if (minus && plus) {
     return OVERSCROLL_BOTH;
@@ -266,28 +266,28 @@ Axis::Overscroll Axis::DisplacementWillO
     return OVERSCROLL_MINUS;
   }
   if (plus) {
     return OVERSCROLL_PLUS;
   }
   return OVERSCROLL_NONE;
 }
 
-CSSCoord Axis::DisplacementWillOverscrollAmount(CSSCoord aDisplacement) {
+float Axis::DisplacementWillOverscrollAmount(float aDisplacement) {
   switch (DisplacementWillOverscroll(aDisplacement)) {
   case OVERSCROLL_MINUS: return (GetOrigin() + aDisplacement) - GetPageStart();
   case OVERSCROLL_PLUS: return (GetCompositionEnd() + aDisplacement) - GetPageEnd();
   // Don't handle overscrolled in both directions; a displacement can't cause
   // this, it must have already been zoomed out too far.
   default: return 0;
   }
 }
 
-CSSCoord Axis::ScaleWillOverscrollAmount(float aScale, CSSCoord aFocus) {
-  CSSCoord originAfterScale = (GetOrigin() + aFocus) - (aFocus / aScale);
+float Axis::ScaleWillOverscrollAmount(float aScale, float aFocus) {
+  float originAfterScale = (GetOrigin() + aFocus) - (aFocus / aScale);
 
   bool both = ScaleWillOverscrollBothSides(aScale);
   bool minus = GetPageStart() - originAfterScale > COORDINATE_EPSILON;
   bool plus = (originAfterScale + (GetCompositionLength() / aScale)) - GetPageEnd() > COORDINATE_EPSILON;
 
   if ((minus && plus) || both) {
     // If we ever reach here it's a bug in the client code.
     MOZ_ASSERT(false, "In an OVERSCROLL_BOTH condition in ScaleWillOverscrollAmount");
@@ -305,39 +305,39 @@ CSSCoord Axis::ScaleWillOverscrollAmount
 float Axis::GetVelocity() {
   return mAxisLocked ? 0 : mVelocity;
 }
 
 void Axis::SetVelocity(float aVelocity) {
   mVelocity = aVelocity;
 }
 
-CSSCoord Axis::GetCompositionEnd() const {
+float Axis::GetCompositionEnd() const {
   return GetOrigin() + GetCompositionLength();
 }
 
-CSSCoord Axis::GetPageEnd() const {
+float Axis::GetPageEnd() const {
   return GetPageStart() + GetPageLength();
 }
 
-CSSCoord Axis::GetOrigin() const {
+float Axis::GetOrigin() const {
   CSSPoint origin = GetFrameMetrics().GetScrollOffset();
   return GetPointOffset(origin);
 }
 
-CSSCoord Axis::GetCompositionLength() const {
+float Axis::GetCompositionLength() const {
   return GetRectLength(GetFrameMetrics().CalculateCompositedRectInCssPixels());
 }
 
-CSSCoord Axis::GetPageStart() const {
+float Axis::GetPageStart() const {
   CSSRect pageRect = GetFrameMetrics().GetExpandedScrollableRect();
   return GetRectOffset(pageRect);
 }
 
-CSSCoord Axis::GetPageLength() const {
+float Axis::GetPageLength() const {
   CSSRect pageRect = GetFrameMetrics().GetExpandedScrollableRect();
   return GetRectLength(pageRect);
 }
 
 bool Axis::ScaleWillOverscrollBothSides(float aScale) {
   const FrameMetrics& metrics = GetFrameMetrics();
 
   CSSToParentLayerScale scale(metrics.GetZoomToParent().scale * aScale);
@@ -352,46 +352,46 @@ const FrameMetrics& Axis::GetFrameMetric
 
 
 AxisX::AxisX(AsyncPanZoomController* aAsyncPanZoomController)
   : Axis(aAsyncPanZoomController)
 {
 
 }
 
-CSSCoord AxisX::GetPointOffset(const CSSPoint& aPoint) const
+float AxisX::GetPointOffset(const CSSPoint& aPoint) const
 {
   return aPoint.x;
 }
 
-CSSCoord AxisX::GetRectLength(const CSSRect& aRect) const
+float AxisX::GetRectLength(const CSSRect& aRect) const
 {
   return aRect.width;
 }
 
-CSSCoord AxisX::GetRectOffset(const CSSRect& aRect) const
+float AxisX::GetRectOffset(const CSSRect& aRect) const
 {
   return aRect.x;
 }
 
 AxisY::AxisY(AsyncPanZoomController* aAsyncPanZoomController)
   : Axis(aAsyncPanZoomController)
 {
 
 }
 
-CSSCoord AxisY::GetPointOffset(const CSSPoint& aPoint) const
+float AxisY::GetPointOffset(const CSSPoint& aPoint) const
 {
   return aPoint.y;
 }
 
-CSSCoord AxisY::GetRectLength(const CSSRect& aRect) const
+float AxisY::GetRectLength(const CSSRect& aRect) const
 {
   return aRect.height;
 }
 
-CSSCoord AxisY::GetRectOffset(const CSSRect& aRect) const
+float AxisY::GetRectOffset(const CSSRect& aRect) const
 {
   return aRect.y;
 }
 
 }
 }
--- a/gfx/layers/apz/src/Axis.h
+++ b/gfx/layers/apz/src/Axis.h
@@ -50,23 +50,23 @@ public:
     // page is scaled out to a smaller size than the viewport.
     OVERSCROLL_BOTH
   };
 
   /**
    * Notify this Axis that a new touch has been received, including a timestamp
    * for when the touch was received. This triggers a recalculation of velocity.
    */
-  void UpdateWithTouchAtDevicePoint(ScreenIntCoord aPos, uint32_t aTimestampMs);
+  void UpdateWithTouchAtDevicePoint(int32_t aPos, uint32_t aTimestampMs);
 
   /**
    * Notify this Axis that a touch has begun, i.e. the user has put their finger
    * on the screen but has not yet tried to pan.
    */
-  void StartTouch(ScreenIntCoord aPos, uint32_t aTimestampMs);
+  void StartTouch(int32_t aPos, uint32_t aTimestampMs);
 
   /**
    * Notify this Axis that a touch has ended gracefully. This may perform
    * recalculations of the axis velocity.
    */
   void EndTouch(uint32_t aTimestampMs);
 
   /**
@@ -82,30 +82,30 @@ public:
    * to account for overscroll (which might decrease the displacement; this is
    * to prevent the viewport from overscrolling the page rect), and axis locking
    * (which might prevent any displacement from happening). If overscroll
    * ocurred, its amount is written to |aOverscrollAmountOut|.
    * The |aDisplacementOut| parameter is set to the adjusted
    * displacement, and the function returns true iff internal overscroll amounts
    * were changed.
    */
-  bool AdjustDisplacement(CSSCoord aDisplacement,
-                          CSSCoord& aDisplacementOut,
-                          CSSCoord& aOverscrollAmountOut);
+  bool AdjustDisplacement(float aDisplacement,
+                          float& aDisplacementOut,
+                          float& aOverscrollAmountOut);
 
   /**
    * Overscrolls this axis by the requested amount in the requested direction.
    * The axis must be at the end of its scroll range in this direction.
    */
-  void OverscrollBy(CSSCoord aOverscroll);
+  void OverscrollBy(float aOverscroll);
 
   /**
    * Return the amount of overscroll on this axis, in CSS pixels.
    */
-  CSSCoord GetOverscroll() const;
+  float GetOverscroll() const;
 
   /**
    * Sample the snap-back animation to relieve overscroll.
    * |aDelta| is the time since the last sample.
    */
   bool SampleSnapBack(const TimeDuration& aDelta);
 
   /**
@@ -124,17 +124,17 @@ public:
    * updateWithTouchAtDevicePoint().
    */
   float PanDistance();
 
   /**
    * Gets the distance between the starting position of the touch supplied in
    * startTouch() and the supplied position.
    */
-  float PanDistance(ScreenIntCoord aPos);
+  float PanDistance(float aPos);
 
   /**
    * Applies friction during a fling, or cancels the fling if the velocity is
    * too low. Returns true if the fling should continue to another frame, or
    * false if it should end.
    * |aDelta| is the amount of time that has passed since the last time
    * friction was applied.
    * |aFriction| is the amount of friction to apply.
@@ -172,95 +172,95 @@ public:
    */
   void SetVelocity(float aVelocity);
 
   /**
    * Gets the overscroll state of the axis given an additional displacement.
    * That is to say, if the given displacement is applied, this will tell you
    * whether or not it will overscroll, and in what direction.
    */
-  Overscroll DisplacementWillOverscroll(CSSCoord aDisplacement);
+  Overscroll DisplacementWillOverscroll(float aDisplacement);
 
   /**
    * If a displacement will overscroll the axis, this returns the amount and in
    * what direction. Similar to GetExcess() but takes a displacement to apply.
    */
-  CSSCoord DisplacementWillOverscrollAmount(CSSCoord aDisplacement);
+  float DisplacementWillOverscrollAmount(float aDisplacement);
 
   /**
    * If a scale will overscroll the axis, this returns the amount and in what
    * direction. Similar to GetExcess() but takes a displacement to apply.
    *
    * |aFocus| is the point at which the scale is focused at. We will offset the
    * scroll offset in such a way that it remains in the same place on the page
    * relative.
    */
-  CSSCoord ScaleWillOverscrollAmount(float aScale, CSSCoord aFocus);
+  float ScaleWillOverscrollAmount(float aScale, float aFocus);
 
   /**
    * Checks if an axis will overscroll in both directions by computing the
    * content rect and checking that its height/width (depending on the axis)
    * does not overextend past the viewport.
    *
    * This gets called by ScaleWillOverscroll().
    */
   bool ScaleWillOverscrollBothSides(float aScale);
 
-  CSSCoord GetOrigin() const;
-  CSSCoord GetCompositionLength() const;
-  CSSCoord GetPageStart() const;
-  CSSCoord GetPageLength() const;
-  CSSCoord GetCompositionEnd() const;
-  CSSCoord GetPageEnd() const;
+  float GetOrigin() const;
+  float GetCompositionLength() const;
+  float GetPageStart() const;
+  float GetPageLength() const;
+  float GetCompositionEnd() const;
+  float GetPageEnd() const;
 
-  ScreenIntCoord GetPos() const { return mPos; }
+  int32_t GetPos() const { return mPos; }
 
-  virtual CSSCoord GetPointOffset(const CSSPoint& aPoint) const = 0;
-  virtual CSSCoord GetRectLength(const CSSRect& aRect) const = 0;
-  virtual CSSCoord GetRectOffset(const CSSRect& aRect) const = 0;
+  virtual float GetPointOffset(const CSSPoint& aPoint) const = 0;
+  virtual float GetRectLength(const CSSRect& aRect) const = 0;
+  virtual float GetRectOffset(const CSSRect& aRect) const = 0;
 
 protected:
-  ScreenIntCoord mPos;
+  int32_t mPos;
   uint32_t mPosTimeMs;
-  ScreenIntCoord mStartPos;
+  int32_t mStartPos;
   float mVelocity;
   bool mAxisLocked;     // Whether movement on this axis is locked.
   AsyncPanZoomController* mAsyncPanZoomController;
   // The amount by which this axis is in overscroll, in CSS coordinates.
   // If this amount is nonzero, the relevant component of
   // mAsyncPanZoomController->mFrameMetrics.mScrollOffset must be at its
   // extreme allowed value in the relevant direction (that is, it must be at
   // its maximum value if mOverscroll is positive, and at its minimum value
   // if mOverscroll is negative).
-  CSSCoord mOverscroll;
+  float mOverscroll;
   // A queue of (timestamp, velocity) pairs; these are the historical
   // velocities at the given timestamps. Timestamps are in milliseconds,
   // velocities are in screen pixels per ms. This member can only be
   // accessed on the controller/UI thread.
   nsTArray<std::pair<uint32_t, float> > mVelocityQueue;
 
   const FrameMetrics& GetFrameMetrics() const;
 
   // Adjust a requested overscroll amount for resistance, yielding a smaller
   // actual overscroll amount.
-  CSSCoord ApplyResistance(CSSCoord aOverscroll) const;
+  float ApplyResistance(float aOverscroll) const;
 };
 
 class AxisX : public Axis {
 public:
   AxisX(AsyncPanZoomController* mAsyncPanZoomController);
-  virtual CSSCoord GetPointOffset(const CSSPoint& aPoint) const;
-  virtual CSSCoord GetRectLength(const CSSRect& aRect) const;
-  virtual CSSCoord GetRectOffset(const CSSRect& aRect) const;
+  virtual float GetPointOffset(const CSSPoint& aPoint) const;
+  virtual float GetRectLength(const CSSRect& aRect) const;
+  virtual float GetRectOffset(const CSSRect& aRect) const;
 };
 
 class AxisY : public Axis {
 public:
   AxisY(AsyncPanZoomController* mAsyncPanZoomController);
-  virtual CSSCoord GetPointOffset(const CSSPoint& aPoint) const;
-  virtual CSSCoord GetRectLength(const CSSRect& aRect) const;
-  virtual CSSCoord GetRectOffset(const CSSRect& aRect) const;
+  virtual float GetPointOffset(const CSSPoint& aPoint) const;
+  virtual float GetRectLength(const CSSRect& aRect) const;
+  virtual float GetRectOffset(const CSSRect& aRect) const;
 };
 
 }
 }
 
 #endif
--- a/gfx/layers/client/ClientTiledThebesLayer.cpp
+++ b/gfx/layers/client/ClientTiledThebesLayer.cpp
@@ -54,17 +54,17 @@ void
 ClientTiledThebesLayer::FillSpecificAttributes(SpecificLayerAttributes& aAttrs)
 {
   aAttrs = ThebesLayerAttributes(GetValidRegion());
 }
 
 static LayerRect
 ApplyParentLayerToLayerTransform(const gfx::Matrix4x4& aTransform, const ParentLayerRect& aParentLayerRect)
 {
-  return TransformTo<LayerPixel>(aTransform, aParentLayerRect);
+  return TransformTo<LayerPixel>(gfx::To3DMatrix(aTransform), aParentLayerRect);
 }
 
 static gfx::Matrix4x4
 GetTransformToAncestorsParentLayer(Layer* aStart, Layer* aAncestor)
 {
   gfx::Matrix4x4 transform;
   Layer* ancestorParent = aAncestor->GetParent();
   for (Layer* iter = aStart; iter != ancestorParent; iter = iter->GetParent()) {
--- a/gfx/layers/client/TiledContentClient.cpp
+++ b/gfx/layers/client/TiledContentClient.cpp
@@ -1231,18 +1231,17 @@ GetCompositorSideCompositionBounds(Conta
   Matrix4x4 transform = aTransformToCompBounds * layerUntransform * nonTransientAPZUntransform;
 
   // Next, apply the APZ's async transform (this includes the nontransient component
   // as well).
   transform = transform * Matrix4x4(aAPZTransform);
 
   // Finally, put back the scroll ancestor's local transform.
   transform = transform * layerTransform;
-  transform.Invert();
-  return TransformTo<LayerPixel>(transform,
+  return TransformTo<LayerPixel>(To3DMatrix(transform).Inverse(),
             aScrollAncestor->GetFrameMetrics().mCompositionBounds);
 }
 
 bool
 ClientTiledLayerBuffer::ComputeProgressiveUpdateRegion(const nsIntRegion& aInvalidRegion,
                                                        const nsIntRegion& aOldValidRegion,
                                                        nsIntRegion& aRegionToPaint,
                                                        BasicTiledLayerPaintData* aPaintData,
--- a/gfx/layers/composite/ContainerLayerComposite.cpp
+++ b/gfx/layers/composite/ContainerLayerComposite.cpp
@@ -217,18 +217,18 @@ static void DrawVelGraph(const nsIntRect
                ColorPattern(Color(0.2f,0,0,1)));
 
   int yScaleFactor = 3;
   Point prev = Point(0,0);
   bool first = true;
   for (int32_t i = (int32_t)velocityData->mData.size() - 2; i >= 0; i--) {
     const gfx::Point& p1 = velocityData->mData[i+1].mPoint;
     const gfx::Point& p2 = velocityData->mData[i].mPoint;
-    int vel = sqrt((p1.x - p2.x).value * (p1.x - p2.x).value +
-                   (p1.y - p2.y).value * (p1.y - p2.y).value);
+    int vel = sqrt((p1.x - p2.x) * (p1.x - p2.x) +
+                   (p1.y - p2.y) * (p1.y - p2.y));
     Point next = Point(graphRect.width / circularBufferSize * i,
                        graphRect.height - vel/yScaleFactor);
     if (first) {
       first = false;
     } else {
       dt->StrokeLine(prev, next, ColorPattern(Color(0,1,0,1)));
     }
     prev = next;
@@ -261,19 +261,21 @@ static void PrintUniformityInfo(Layer* a
 
   // Don't want to print a log for smaller layers
   if (aLayer->GetEffectiveVisibleRegion().GetBounds().width < 300 ||
       aLayer->GetEffectiveVisibleRegion().GetBounds().height < 300) {
     return;
   }
 
   FrameMetrics frameMetrics = aLayer->AsContainerLayer()->GetFrameMetrics();
-  const LayerPoint scrollOffset = frameMetrics.GetScrollOffsetInLayerPixels();
+  LayerIntPoint scrollOffset = RoundedToInt(frameMetrics.GetScrollOffsetInLayerPixels());
   const gfx::Point layerTransform = GetScrollData(aLayer);
-  const gfx::Point layerScroll = scrollOffset.ToUnknownPoint() - layerTransform;
+  gfx::Point layerScroll;
+  layerScroll.x = scrollOffset.x - layerTransform.x;
+  layerScroll.y = scrollOffset.y - layerTransform.y;
 
   printf_stderr("UniformityInfo Layer_Move %llu %p %f, %f\n",
     TimeStamp::Now(), aLayer, layerScroll.x, layerScroll.y);
 }
 
 /* all of the per-layer prepared data we need to maintain */
 struct PreparedLayer
 {
--- a/gfx/layers/opengl/CompositorOGL.cpp
+++ b/gfx/layers/opengl/CompositorOGL.cpp
@@ -469,18 +469,18 @@ DecomposeIntoNoRepeatRects(const Rect& a
              aRect.x, aRect.y, aRect.XMost(), aRect.YMost(),
              tl.x, tl.y, br.x, br.y,
              flipped);
     return 1;
   }
 
   // If we are dealing with wrapping br.x and br.y are greater than 1.0 so
   // wrap them here as well.
-  br = Point(xwrap ? WrapTexCoord(br.x) : br.x.value,
-             ywrap ? WrapTexCoord(br.y) : br.y.value);
+  br = Point(xwrap ? WrapTexCoord(br.x) : br.x,
+             ywrap ? WrapTexCoord(br.y) : br.y);
 
   // If we wrap around along the x axis, we will draw first from
   // tl.x .. 1.0 and then from 0.0 .. br.x (which we just wrapped above).
   // The same applies for the Y axis. The midpoints we calculate here are
   // only valid if we actually wrap around.
   GLfloat xmid = aRect.x + (1.0f - tl.x) / texCoordRect.width * aRect.width;
   GLfloat ymid = aRect.y + (1.0f - tl.y) / texCoordRect.height * aRect.height;
 
@@ -754,17 +754,18 @@ CompositorOGL::BeginFrame(const nsIntReg
   TexturePoolOGL::Fill(gl());
 #endif
 
   // Make sure the render offset is respected. We ignore this when we have a
   // target to stop tests failing - this is only used by the Android browser
   // UI for its dynamic toolbar.
   IntPoint origin;
   if (!mTarget) {
-    origin = -TruncatedToInt(mRenderOffset.ToUnknownPoint());
+    origin.x = -mRenderOffset.x;
+    origin.y = -mRenderOffset.y;
   }
 
   mCurrentRenderTarget =
     CompositingRenderTargetOGL::RenderTargetForWindow(this,
                                                       origin,
                                                       IntSize(width, height),
                                                       aTransform);
   mCurrentRenderTarget->BindRenderTarget();
--- a/layout/base/UnitTransforms.h
+++ b/layout/base/UnitTransforms.h
@@ -3,17 +3,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef MOZ_UNIT_TRANSFORMS_H_
 #define MOZ_UNIT_TRANSFORMS_H_
 
 #include "Units.h"
-#include "mozilla/gfx/Matrix.h"
 
 namespace mozilla {
 
 // Convenience functions for converting an entity from one strongly-typed
 // coordinate system to another without changing the values it stores (this
 // can be thought of as a cast).
 // To use these functions, you must provide a justification for each use!
 // Feel free to add more justifications to PixelCastJustification, along with
@@ -38,53 +37,55 @@ gfx::IntSizeTyped<TargetUnits> ViewAs(co
 // Convenience functions for casting untyped entities to typed entities.
 // Using these functions does not require a justification, but once we convert
 // all code to use strongly typed units they should not be needed any longer.
 template <class TargetUnits>
 gfx::PointTyped<TargetUnits> ViewAs(const gfxPoint& aPoint) {
   return gfx::PointTyped<TargetUnits>(aPoint.x, aPoint.y);
 }
 template <class TargetUnits>
-gfx::PointTyped<TargetUnits> ViewAs(const gfx::Point& aPoint) {
-  return gfx::PointTyped<TargetUnits>(aPoint.x, aPoint.y);
-}
-template <class TargetUnits>
-gfx::RectTyped<TargetUnits> ViewAs(const gfx::Rect& aRect) {
+gfx::RectTyped<TargetUnits> ViewAs(const gfxRect& aRect) {
   return gfx::RectTyped<TargetUnits>(aRect.x, aRect.y, aRect.width, aRect.height);
 }
 template <class TargetUnits>
 gfx::IntSizeTyped<TargetUnits> ViewAs(const nsIntSize& aSize) {
   return gfx::IntSizeTyped<TargetUnits>(aSize.width, aSize.height);
 }
 template <class TargetUnits>
 gfx::IntPointTyped<TargetUnits> ViewAs(const nsIntPoint& aPoint) {
   return gfx::IntPointTyped<TargetUnits>(aPoint.x, aPoint.y);
 }
 template <class TargetUnits>
 gfx::IntRectTyped<TargetUnits> ViewAs(const nsIntRect& aRect) {
   return gfx::IntRectTyped<TargetUnits>(aRect.x, aRect.y, aRect.width, aRect.height);
 }
 
+// Convenience functions for casting typed entities to untyped entities.
+// Using these functions does not require a justification, but once we convert
+// all code to use strongly typed units they should not be needed any longer.
+template <class SourceUnits>
+gfxPoint ViewAsUntyped(const gfx::PointTyped<SourceUnits>& aPoint) {
+  return gfxPoint(aPoint.x, aPoint.y);
+}
+template <class SourceUnits>
+gfxRect ViewAsUntyped(const gfx::RectTyped<SourceUnits>& aRect) {
+  return gfxRect(aRect.x, aRect.y, aRect.width, aRect.height);
+}
+
 // Convenience functions for transforming an entity from one strongly-typed
 // coordinate system to another using the provided transformation matrix.
 template <typename TargetUnits, typename SourceUnits>
-static gfx::PointTyped<TargetUnits> TransformTo(const gfx::Matrix4x4& aTransform,
+static gfx::PointTyped<TargetUnits> TransformTo(const gfx3DMatrix& aTransform,
                                                 const gfx::PointTyped<SourceUnits>& aPoint)
 {
-  return ViewAs<TargetUnits>(aTransform * aPoint.ToUnknownPoint());
+  return ViewAs<TargetUnits>(aTransform.Transform(ViewAsUntyped(aPoint)));
 }
 template <typename TargetUnits, typename SourceUnits>
-static gfx::IntPointTyped<TargetUnits> TransformTo(const gfx::Matrix4x4& aTransform,
-                                                   const gfx::IntPointTyped<SourceUnits>& aPoint)
-{
-  return RoundedToInt(TransformTo<TargetUnits>(aTransform, gfx::PointTyped<SourceUnits>(aPoint)));
-}
-template <typename TargetUnits, typename SourceUnits>
-static gfx::RectTyped<TargetUnits> TransformTo(const gfx::Matrix4x4& aTransform,
+static gfx::RectTyped<TargetUnits> TransformTo(const gfx3DMatrix& aTransform,
                                                const gfx::RectTyped<SourceUnits>& aRect)
 {
-  return ViewAs<TargetUnits>(aTransform.TransformBounds(aRect.ToUnknownRect()));
+  return ViewAs<TargetUnits>(aTransform.TransformBounds(ViewAsUntyped(aRect)));
 }
 
 
 }
 
 #endif
--- a/layout/base/Units.h
+++ b/layout/base/Units.h
@@ -2,17 +2,16 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef MOZ_UNITS_H_
 #define MOZ_UNITS_H_
 
-#include "mozilla/gfx/Coord.h"
 #include "mozilla/gfx/Point.h"
 #include "mozilla/gfx/Rect.h"
 #include "mozilla/gfx/ScaleFactor.h"
 #include "nsRect.h"
 #include "nsMargin.h"
 #include "mozilla/AppUnits.h"
 #include "mozilla/TypeTraits.h"
 
@@ -26,51 +25,43 @@ struct LayoutDevicePixel;
 struct LayerPixel;
 struct ScreenPixel;
 
 template<> struct IsPixel<CSSPixel>          : TrueType {};
 template<> struct IsPixel<LayoutDevicePixel> : TrueType {};
 template<> struct IsPixel<LayerPixel>        : TrueType {};
 template<> struct IsPixel<ScreenPixel>       : TrueType {};
 
-typedef gfx::CoordTyped<CSSPixel> CSSCoord;
-typedef gfx::IntCoordTyped<CSSPixel> CSSIntCoord;
 typedef gfx::PointTyped<CSSPixel> CSSPoint;
 typedef gfx::IntPointTyped<CSSPixel> CSSIntPoint;
 typedef gfx::SizeTyped<CSSPixel> CSSSize;
 typedef gfx::IntSizeTyped<CSSPixel> CSSIntSize;
 typedef gfx::RectTyped<CSSPixel> CSSRect;
 typedef gfx::IntRectTyped<CSSPixel> CSSIntRect;
 typedef gfx::MarginTyped<CSSPixel> CSSMargin;
 typedef gfx::IntMarginTyped<CSSPixel> CSSIntMargin;
 
-typedef gfx::CoordTyped<LayoutDevicePixel> LayoutDeviceCoord;
-typedef gfx::IntCoordTyped<LayoutDevicePixel> LayoutDeviceIntCoord;
 typedef gfx::PointTyped<LayoutDevicePixel> LayoutDevicePoint;
 typedef gfx::IntPointTyped<LayoutDevicePixel> LayoutDeviceIntPoint;
 typedef gfx::SizeTyped<LayoutDevicePixel> LayoutDeviceSize;
 typedef gfx::IntSizeTyped<LayoutDevicePixel> LayoutDeviceIntSize;
 typedef gfx::RectTyped<LayoutDevicePixel> LayoutDeviceRect;
 typedef gfx::IntRectTyped<LayoutDevicePixel> LayoutDeviceIntRect;
 typedef gfx::MarginTyped<LayoutDevicePixel> LayoutDeviceMargin;
 typedef gfx::IntMarginTyped<LayoutDevicePixel> LayoutDeviceIntMargin;
 
-typedef gfx::CoordTyped<LayerPixel> LayerCoord;
-typedef gfx::IntCoordTyped<LayerPixel> LayerIntCoord;
 typedef gfx::PointTyped<LayerPixel> LayerPoint;
 typedef gfx::IntPointTyped<LayerPixel> LayerIntPoint;
 typedef gfx::SizeTyped<LayerPixel> LayerSize;
 typedef gfx::IntSizeTyped<LayerPixel> LayerIntSize;
 typedef gfx::RectTyped<LayerPixel> LayerRect;
 typedef gfx::IntRectTyped<LayerPixel> LayerIntRect;
 typedef gfx::MarginTyped<LayerPixel> LayerMargin;
 typedef gfx::IntMarginTyped<LayerPixel> LayerIntMargin;
 
-typedef gfx::CoordTyped<ScreenPixel> ScreenCoord;
-typedef gfx::IntCoordTyped<ScreenPixel> ScreenIntCoord;
 typedef gfx::PointTyped<ScreenPixel> ScreenPoint;
 typedef gfx::IntPointTyped<ScreenPixel> ScreenIntPoint;
 typedef gfx::SizeTyped<ScreenPixel> ScreenSize;
 typedef gfx::IntSizeTyped<ScreenPixel> ScreenIntSize;
 typedef gfx::RectTyped<ScreenPixel> ScreenRect;
 typedef gfx::IntRectTyped<ScreenPixel> ScreenIntRect;
 typedef gfx::MarginTyped<ScreenPixel> ScreenMargin;
 typedef gfx::IntMarginTyped<ScreenPixel> ScreenIntMargin;
--- a/widget/xpwidgets/nsBaseWidget.cpp
+++ b/widget/xpwidgets/nsBaseWidget.cpp
@@ -1800,18 +1800,18 @@ nsBaseWidget::debug_DumpEvent(FILE *    
 
   fprintf(aFileOut,
           "%4d %-26s widget=%-8p name=%-12s id=0x%-6x refpt=%d,%d\n",
           _GetPrintCount(),
           tempString.get(),
           (void *) aWidget,
           aWidgetName.get(),
           aWindowID,
-          aGuiEvent->refPoint.x.value,
-          aGuiEvent->refPoint.y.value);
+          aGuiEvent->refPoint.x,
+          aGuiEvent->refPoint.y);
 }
 //////////////////////////////////////////////////////////////
 /* static */ void
 nsBaseWidget::debug_DumpPaintEvent(FILE *                aFileOut,
                                    nsIWidget *           aWidget,
                                    const nsIntRegion &   aRegion,
                                    const nsAutoCString & aWidgetName,
                                    int32_t               aWindowID)