Bug 1098417 part 2: Make nsImageFrame pass "object-position"-determined anchor-point to DrawSingleImage. r=seth
authorDaniel Holbert <dholbert@cs.stanford.edu>
Tue, 25 Nov 2014 16:46:14 -0800
changeset 241853 ea1bc74871c0b205a9ccd741b8e0888baf1afcef
parent 241852 aa382f6ee7ba6adac3390495038103d2e893a15f
child 241854 7ac2902afded1bcd69bd654cafe9de8cf5e419ed
push id4311
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 19:37:41 +0000
treeherdermozilla-beta@150c9fed433b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersseth
bugs1098417
milestone36.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
Bug 1098417 part 2: Make nsImageFrame pass "object-position"-determined anchor-point to DrawSingleImage. r=seth
layout/generic/nsImageFrame.cpp
--- a/layout/generic/nsImageFrame.cpp
+++ b/layout/generic/nsImageFrame.cpp
@@ -1533,25 +1533,27 @@ nsImageFrame::PaintImage(nsRenderingCont
 
   // NOTE: We use mComputedSize instead of just GetInnerArea()'s own size here,
   // because GetInnerArea() might be smaller if we're fragmented, whereas
   // mComputedSize has our full content-box size (which we need for
   // ComputeObjectDestRect to work correctly).
   nsRect constraintRect(aPt + GetInnerArea().TopLeft(), mComputedSize);
   constraintRect.y -= GetContinuationOffset();
 
+  nsPoint anchorPoint;
   nsRect dest = nsLayoutUtils::ComputeObjectDestRect(constraintRect,
                                                      mIntrinsicSize,
                                                      mIntrinsicRatio,
-                                                     StylePosition());
+                                                     StylePosition(),
+                                                     &anchorPoint);
 
   nsLayoutUtils::DrawSingleImage(*aRenderingContext.ThebesContext(),
     PresContext(), aImage,
     nsLayoutUtils::GetGraphicsFilterForFrame(this), dest, aDirtyRect,
-    nullptr, aFlags);
+    nullptr, aFlags, &anchorPoint);
 
   nsImageMap* map = GetImageMap();
   if (map) {
     gfxPoint devPixelOffset =
       nsLayoutUtils::PointToGfxPoint(dest.TopLeft(),
                                      PresContext()->AppUnitsPerDevPixel());
     AutoRestoreTransform autoRestoreTransform(drawTarget);
     drawTarget->SetTransform(