Bug 1165185 - Nudge layer prescale to integers. r=roc

This commit is contained in:
Markus Stange 2015-06-16 17:02:58 -04:00
parent 2e0f2286ad
commit 9456af6ff1

View File

@ -4586,6 +4586,15 @@ static inline gfxSize RoundToFloatPrecision(const gfxSize& aSize)
return gfxSize(float(aSize.width), float(aSize.height));
}
static inline gfxSize NudgedToIntegerSize(const gfxSize& aSize)
{
float width = aSize.width;
float height = aSize.height;
gfx::NudgeToInteger(&width);
gfx::NudgeToInteger(&height);
return gfxSize(width, height);
}
static void RestrictScaleToMaxLayerSize(gfxSize& aScale,
const nsRect& aVisibleRect,
nsIFrame* aContainerFrame,
@ -4704,7 +4713,7 @@ ChooseScaleAndSetTransform(FrameLayerBuilder* aLayerBuilder,
scale.height = gfxUtils::ClampToScaleFactor(scale.height);
}
} else {
// XXX Do we need to move nearly-integer values to integers here?
scale = NudgedToIntegerSize(scale);
}
}
// If the scale factors are too small, just use 1.0. The content is being