1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef UI_COMPOSITOR_DIP_UTIL_H_
6 #define UI_COMPOSITOR_DIP_UTIL_H_
8 #include "ui/compositor/compositor_export.h"
9 #include "base/basictypes.h"
20 COMPOSITOR_EXPORT
float GetDeviceScaleFactor(const Layer
* layer
);
22 // Utility functions that convert point/size/rect between
23 // DIP and pixel coordinates system.
24 COMPOSITOR_EXPORT
gfx::Point
ConvertPointToDIP(
26 const gfx::Point
& point_in_pixel
);
27 COMPOSITOR_EXPORT
gfx::Size
ConvertSizeToDIP(
29 const gfx::Size
& size_in_pixel
);
30 COMPOSITOR_EXPORT
gfx::Rect
ConvertRectToDIP(
32 const gfx::Rect
& rect_in_pixel
);
33 COMPOSITOR_EXPORT
gfx::Point
ConvertPointToPixel(
35 const gfx::Point
& point_in_dip
);
36 COMPOSITOR_EXPORT
gfx::Size
ConvertSizeToPixel(
38 const gfx::Size
& size_in_dip
);
39 COMPOSITOR_EXPORT
gfx::Rect
ConvertRectToPixel(
41 const gfx::Rect
& rect_in_dip
);
45 #endif // UI_COMPOSITOR_DIP_UTIL_H_