Backed out changeset c035d63ade9d (bug 1068881)
authorSeth Fowler <seth@mozilla.com>
Thu, 26 Mar 2015 15:45:00 -0700
changeset 266363 ad2032c2de8c5819f8e85ef71eb679765bbd9263
parent 266362 2c368e6b267e29f2d178da85f4fbaf38d0efb34a
child 266364 56f423225af593cc2f82c2f27e2470671e1c3489
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1068881
milestone39.0a1
backs outc035d63ade9d23b29b357656a6c6d6e3785315ec
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 changeset c035d63ade9d (bug 1068881)
layout/base/nsLayoutUtils.cpp
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -5872,35 +5872,28 @@ ComputeSnappedImageDrawingParameters(gfx
     if (fill.IsEmpty()) {
       return SnappedImageDrawingParameters();
     }
   } else {
     didSnap = false;
     fill = devPixelFill;
   }
 
-  // Apply the context's scale to the dest rect.
   gfxSize destScale = didSnap ? gfxSize(currentMatrix._11, currentMatrix._22)
                               : currentMatrix.ScaleFactors(true);
   gfxSize appUnitScaledDest(dest.width * destScale.width,
                             dest.height * destScale.height);
   gfxSize scaledDest = appUnitScaledDest / aAppUnitsPerDevPixel;
-  if (scaledDest.IsEmpty()) {
-    return SnappedImageDrawingParameters();
-  }
-
-  // Compute a snapped version of the scaled dest rect, which we'll use to
-  // determine the optimal image size to draw with. We need to be sure that
-  // this rect is at least one pixel in width and height, or we'll end up
-  // drawing nothing even if we have a nonempty fill.
   gfxSize snappedScaledDest =
     gfxSize(NSAppUnitsToIntPixels(appUnitScaledDest.width, aAppUnitsPerDevPixel),
             NSAppUnitsToIntPixels(appUnitScaledDest.height, aAppUnitsPerDevPixel));
-  snappedScaledDest.width = std::max(snappedScaledDest.width, 1.0);
-  snappedScaledDest.height = std::max(snappedScaledDest.height, 1.0);
+
+  if (scaledDest.IsEmpty() || snappedScaledDest.IsEmpty()) {
+    return SnappedImageDrawingParameters();
+  }
 
   nsIntSize intImageSize =
     aImage->OptimalImageSizeForDest(snappedScaledDest,
                                     imgIContainer::FRAME_CURRENT,
                                     aGraphicsFilter, aImageFlags);
   gfxSize imageSize(intImageSize.width, intImageSize.height);
 
   nsIntSize svgViewportSize = currentMatrix.IsIdentity()