Use double precision when computing the backdrop copy rect. (bug 1243071 part 2, r=mattwoodrow)
authorDavid Anderson <danderson@mozilla.com>
Mon, 01 Feb 2016 16:27:49 -0800
changeset 318982 53ddcd8fee2647d0fc447791ec35236d220c2924
parent 318981 975654b9b3d80a11d881b0e2cc249791bf27b59c
child 318983 94d3822922608c051a3843c87207fd4a4f5445e2
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1243071
milestone47.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
Use double precision when computing the backdrop copy rect. (bug 1243071 part 2, r=mattwoodrow)
gfx/2d/Rect.h
gfx/layers/Compositor.cpp
--- a/gfx/2d/Rect.h
+++ b/gfx/2d/Rect.h
@@ -179,18 +179,18 @@ struct RectTyped :
       NudgeToInteger(&(this->width));
       NudgeToInteger(&(this->height));
     }
 
     bool ToIntRect(IntRectTyped<units> *aOut) const
     {
       *aOut = IntRectTyped<units>(int32_t(this->X()), int32_t(this->Y()),
                                   int32_t(this->Width()), int32_t(this->Height()));
-      return RectTyped<units>(F(aOut->x), F(aOut->y),
-                              F(aOut->width), F(aOut->height))
+      return RectTyped<units, F>(F(aOut->x), F(aOut->y),
+                                 F(aOut->width), F(aOut->height))
              .IsEqualEdges(*this);
     }
 
     // XXX When all of the code is ported, the following functions to convert to and from
     // unknown types should be removed.
 
     static RectTyped<units, F> FromUnknownRect(const RectTyped<UnknownUnits, F>& rect) {
         return RectTyped<units, F>(rect.x, rect.y, rect.width, rect.height);
--- a/gfx/layers/Compositor.cpp
+++ b/gfx/layers/Compositor.cpp
@@ -364,21 +364,23 @@ Compositor::ComputeBackdropCopyRect(cons
   gfx::IntPoint rtOffset = GetCurrentRenderTarget()->GetOrigin();
   gfx::IntSize rtSize = GetCurrentRenderTarget()->GetSize();
 
   gfx::Rect renderBounds(0, 0, rtSize.width, rtSize.height);
   renderBounds.IntersectRect(renderBounds, aClipRect);
   renderBounds.MoveBy(rtOffset);
 
   // Apply the layer transform.
-  gfx::Rect dest = aTransform.TransformAndClipBounds(aRect, renderBounds);
+  gfx::RectDouble dest = aTransform.TransformAndClipBounds(
+    gfx::RectDouble(aRect.x, aRect.y, aRect.width, aRect.height),
+    gfx::RectDouble(renderBounds.x, renderBounds.y, renderBounds.width, renderBounds.height));
   dest -= rtOffset;
 
   // Ensure we don't round out to -1, which trips up Direct3D.
-  dest.IntersectRect(dest, gfx::Rect(0, 0, rtSize.width, rtSize.height));
+  dest.IntersectRect(dest, gfx::RectDouble(0, 0, rtSize.width, rtSize.height));
 
   // Round out to integer.
   gfx::IntRect result;
   dest.RoundOut();
   dest.ToIntRect(&result);
 
   // Create a transform from adjusted clip space to render target space,
   // translate it for the backdrop rect, then transform it into the backdrop's