diff options
Diffstat (limited to 'ui')
-rw-r--r-- | ui/compositor/dip_util.cc | 5 | ||||
-rw-r--r-- | ui/compositor/dip_util.h | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/ui/compositor/dip_util.cc b/ui/compositor/dip_util.cc index 104a5da..1f6309a 100644 --- a/ui/compositor/dip_util.cc +++ b/ui/compositor/dip_util.cc @@ -29,6 +29,11 @@ gfx::Point ConvertPointToDIP(const Layer* layer, gfx::ScalePoint(point_in_pixel, 1.0f / GetDeviceScaleFactor(layer))); } +gfx::PointF ConvertPointToDIP(const Layer* layer, + const gfx::PointF& point_in_pixel) { + return gfx::ScalePoint(point_in_pixel, 1.0f / GetDeviceScaleFactor(layer)); +} + gfx::Size ConvertSizeToDIP(const Layer* layer, const gfx::Size& size_in_pixel) { return gfx::ToFlooredSize( diff --git a/ui/compositor/dip_util.h b/ui/compositor/dip_util.h index d793dc7..e8d0367 100644 --- a/ui/compositor/dip_util.h +++ b/ui/compositor/dip_util.h @@ -7,6 +7,7 @@ #include "ui/compositor/compositor_export.h" #include "base/basictypes.h" +#include "ui/gfx/point_f.h" namespace gfx { class Point; @@ -24,6 +25,9 @@ COMPOSITOR_EXPORT float GetDeviceScaleFactor(const Layer* layer); COMPOSITOR_EXPORT gfx::Point ConvertPointToDIP( const Layer* layer, const gfx::Point& point_in_pixel); +COMPOSITOR_EXPORT gfx::PointF ConvertPointToDIP( + const Layer* layer, + const gfx::PointF& point_in_pixel); COMPOSITOR_EXPORT gfx::Size ConvertSizeToDIP( const Layer* layer, const gfx::Size& size_in_pixel); |