Bug 1078337 - Use the clipped image in DrawSingleImage if one was requested. r=seth
☠☠ backed out by f547cf19d104 ☠ ☠
authorMatt Woodrow <mwoodrow@mozilla.com>
Mon, 13 Oct 2014 11:49:22 +1300
changeset 210032 7ab2fdaadd1a2bbd368ac961c98d786cf4ac084d
parent 210031 4ffbb6be512d6acd0b9157492440156ecd241652
child 210033 3e73b907138475c5906322aeadc62130c0e7baa6
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersseth
bugs1078337
milestone35.0a1
Bug 1078337 - Use the clipped image in DrawSingleImage if one was requested. r=seth
layout/base/nsLayoutUtils.cpp
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -5328,25 +5328,23 @@ nsLayoutUtils::DrawSingleImage(nsRenderi
     image = ImageOps::Clip(aImage, subRect);
   } else {
     nscoord appUnitsPerCSSPixel = nsDeviceContext::AppUnitsPerCSSPixel();
     source.SizeTo(imageSize.width*appUnitsPerCSSPixel,
                   imageSize.height*appUnitsPerCSSPixel);
     image = aImage;
   }
 
-  nsRect dest = nsLayoutUtils::GetWholeImageDestination(imageSize, source,
-                                                        aDest);
   // Ensure that only a single image tile is drawn. If aSourceArea extends
   // outside the image bounds, we want to honor the aSourceArea-to-aDest
   // transform but we don't want to actually tile the image.
   nsRect fill;
-  fill.IntersectRect(aDest, dest);
-  return DrawImageInternal(aRenderingContext, aPresContext, aImage,
-                           aGraphicsFilter, dest, fill, fill.TopLeft(),
+  fill.IntersectRect(aDest, aDest);
+  return DrawImageInternal(aRenderingContext, aPresContext, image,
+                           aGraphicsFilter, aDest, fill, fill.TopLeft(),
                            aDirty, aSVGContext, aImageFlags);
 }
 
 /* static */ void
 nsLayoutUtils::ComputeSizeForDrawing(imgIContainer *aImage,
                                      nsIntSize&     aImageSize, /*outparam*/
                                      nsSize&        aIntrinsicRatio, /*outparam*/
                                      bool&          aGotWidth,  /*outparam*/