Bug 1339661. Part 2: Ensure we do floating point division. r=xidorn
authorMason Chang <mchang@mozilla.com>
Thu, 23 Feb 2017 09:12:15 -0800
changeset 374802 b323a395e46e436062971eda9b675c1dbbcfc55e
parent 374801 c79c28db46db4e567f6c8fa918c31aa4f90ded86
child 374803 b545b4883b898a78f6071c9ef4cd627037b2fc08
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersxidorn
bugs1339661
milestone54.0a1
Bug 1339661. Part 2: Ensure we do floating point division. r=xidorn
layout/painting/nsDisplayList.cpp
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -4798,20 +4798,20 @@ nsDisplayBoxShadowOuter::CreateWebRender
       shadowOffset.x = (shadow->mXOffset / appUnitsPerDevPixel);
       shadowOffset.y = (shadow->mYOffset / appUnitsPerDevPixel);
 
       Rect deviceBoxRect = NSRectToRect(shadowRect, appUnitsPerDevPixel);
       deviceBoxRect = aLayer->RelativeToParent(deviceBoxRect);
 
       Rect deviceClipRect = aLayer->RelativeToParent(clipRect + shadowOffset);
 
-      float blurRadius = shadow->mRadius / appUnitsPerDevPixel;
+      float blurRadius = float(shadow->mRadius) / float(appUnitsPerDevPixel);
       // TODO: Calculate the border radius here.
       float borderRadius = 0.0;
-      float spreadRadius = shadow->mSpread / appUnitsPerDevPixel;
+      float spreadRadius = float(shadow->mSpread) / float(appUnitsPerDevPixel);
 
       aCommands.AppendElement(OpDPPushBoxShadow(
                               wr::ToWrRect(deviceBoxRect),
                               wr::ToWrRect(deviceClipRect),
                               wr::ToWrRect(deviceBoxRect),
                               wr::ToWrPoint(shadowOffset),
                               wr::ToWrColor(shadowColor),
                               blurRadius,