Bug 1383204 - Change helper function's return type to be more strongly typed. r?mattwoodrow draft
authorKartikaya Gupta <kgupta@mozilla.com>
Fri, 21 Jul 2017 14:37:38 -0400
changeset 613171 5b1707ca345a8c55b4f6de37251fdd3ced93d36e
parent 613170 02ddb62be2df834c207ea7f42dd9ac832d44fcc4
child 613172 55153026ea9c1bfb859d731692deb6c513b53f03
push id69748
push userkgupta@mozilla.com
push dateFri, 21 Jul 2017 18:37:55 +0000
reviewersmattwoodrow
bugs1383204
milestone56.0a1
Bug 1383204 - Change helper function's return type to be more strongly typed. r?mattwoodrow No functional change here, but this makes the next patch simpler. MozReview-Commit-ID: 1zslyrj55r0
layout/ipc/RenderFrameParent.cpp
--- a/layout/ipc/RenderFrameParent.cpp
+++ b/layout/ipc/RenderFrameParent.cpp
@@ -44,29 +44,29 @@ namespace layout {
 
 typedef FrameMetrics::ViewID ViewID;
 
 /**
  * Gets the layer-pixel offset of aContainerFrame's content rect top-left
  * from the nearest display item reference frame (which we assume will be inducing
  * a ContainerLayer).
  */
-static nsIntPoint
+static LayoutDeviceIntPoint
 GetContentRectLayerOffset(nsIFrame* aContainerFrame, nsDisplayListBuilder* aBuilder)
 {
   nscoord auPerDevPixel = aContainerFrame->PresContext()->AppUnitsPerDevPixel();
 
   // Offset to the content rect in case we have borders or padding
   // Note that aContainerFrame could be a reference frame itself, so
   // we need to be careful here to ensure that we call ToReferenceFrame
   // on aContainerFrame and not its parent.
   nsPoint frameOffset = aBuilder->ToReferenceFrame(aContainerFrame) +
     aContainerFrame->GetContentRectRelativeToSelf().TopLeft();
 
-  return frameOffset.ToNearestPixels(auPerDevPixel);
+  return LayoutDeviceIntPoint::FromAppUnitsToNearest(frameOffset, auPerDevPixel);
 }
 
 // Return true iff |aManager| is a "temporary layer manager".  They're
 // used for small software rendering tasks, like drawWindow.  That's
 // currently implemented by a BasicLayerManager without a backing
 // widget, and hence in non-retained mode.
 inline static bool
 IsTempLayerManager(LayerManager* aManager)
@@ -194,17 +194,17 @@ RenderFrameParent::BuildLayer(nsDisplayL
     layer = aManager->CreateRefLayer();
   }
   if (!layer) {
     // Probably a temporary layer manager that doesn't know how to
     // use ref layers.
     return nullptr;
   }
   static_cast<RefLayer*>(layer.get())->SetReferentId(mLayersId);
-  nsIntPoint offset = GetContentRectLayerOffset(aFrame, aBuilder);
+  LayoutDeviceIntPoint offset = GetContentRectLayerOffset(aFrame, aBuilder);
   // We can only have an offset if we're a child of an inactive
   // container, but our display item is LAYER_ACTIVE_FORCE which
   // forces all layers above to be active.
   MOZ_ASSERT(aContainerParameters.mOffset == nsIntPoint());
   gfx::Matrix4x4 m = gfx::Matrix4x4::Translation(offset.x, offset.y, 0.0);
   // Remote content can't be repainted by us, so we multiply down
   // the resolution that our container expects onto our container.
   m.PreScale(aContainerParameters.mXScale, aContainerParameters.mYScale, 1.0);