Bug 1158120 - Replace nsIntSize by mozilla::gfx::IntSize in gfx/src/nsSize.h. r=nical

This commit is contained in:
Amanda Sambath 2015-05-29 15:33:34 +02:00
Родитель 00f98b50e9
Коммит d8f41cff5d
1 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -22,9 +22,9 @@ struct nsSize : public mozilla::gfx::BaseSize<nscoord, nsSize> {
nsSize() : Super() {}
nsSize(nscoord aWidth, nscoord aHeight) : Super(aWidth, aHeight) {}
inline nsIntSize ScaleToNearestPixels(float aXScale, float aYScale,
inline mozilla::gfx::IntSize ScaleToNearestPixels(float aXScale, float aYScale,
nscoord aAppUnitsPerPixel) const;
inline nsIntSize ToNearestPixels(nscoord aAppUnitsPerPixel) const;
inline mozilla::gfx::IntSize ToNearestPixels(nscoord aAppUnitsPerPixel) const;
/**
* Return this size scaled to a different appunits per pixel (APP) ratio.
@ -35,16 +35,16 @@ struct nsSize : public mozilla::gfx::BaseSize<nscoord, nsSize> {
ScaleToOtherAppUnits(int32_t aFromAPP, int32_t aToAPP) const;
};
inline nsIntSize
inline mozilla::gfx::IntSize
nsSize::ScaleToNearestPixels(float aXScale, float aYScale,
nscoord aAppUnitsPerPixel) const
{
return nsIntSize(
return mozilla::gfx::IntSize(
NSToIntRoundUp(NSAppUnitsToDoublePixels(width, aAppUnitsPerPixel) * aXScale),
NSToIntRoundUp(NSAppUnitsToDoublePixels(height, aAppUnitsPerPixel) * aYScale));
}
inline nsIntSize
inline mozilla::gfx::IntSize
nsSize::ToNearestPixels(nscoord aAppUnitsPerPixel) const
{
return ScaleToNearestPixels(1.0f, 1.0f, aAppUnitsPerPixel);