Bug 1205511 - Give nsPresContext a method that returns the CSS to device pixel scale. r=dbaron

--HG--
extra : source : 50b0470193cef87e4292aee14dc940b39864832d
This commit is contained in:
Botond Ballo 2015-09-28 20:13:52 -04:00
Родитель 38f11673f3
Коммит 705ac24ef9
1 изменённых файлов: 7 добавлений и 0 удалений

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

@ -38,6 +38,7 @@
#include "ScrollbarStyles.h"
#include "nsIMessageManager.h"
#include "mozilla/RestyleLogging.h"
#include "Units.h"
class nsAString;
class nsIPrintSettings;
@ -636,6 +637,12 @@ public:
float DevPixelsToFloatCSSPixels(int32_t aPixels)
{ return AppUnitsToFloatCSSPixels(DevPixelsToAppUnits(aPixels)); }
mozilla::CSSToLayoutDeviceScale CSSToDevPixelScale() const
{
return mozilla::CSSToLayoutDeviceScale(
float(AppUnitsPerCSSPixel()) / float(AppUnitsPerDevPixel()));
}
// If there is a remainder, it is rounded to nearest app units.
nscoord GfxUnitsToAppUnits(gfxFloat aGfxUnits) const;