[Android] Remove the webview_core static library.
[chromium-blink-merge.git] / ui / compositor / dip_util.h
blobd793dc7d99966437fb51a2686aec8d62bd06256c
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"
11 namespace gfx {
12 class Point;
13 class Size;
14 class Rect;
15 } // namespace gfx
17 namespace ui {
18 class Layer;
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(
25 const Layer* layer,
26 const gfx::Point& point_in_pixel);
27 COMPOSITOR_EXPORT gfx::Size ConvertSizeToDIP(
28 const Layer* layer,
29 const gfx::Size& size_in_pixel);
30 COMPOSITOR_EXPORT gfx::Rect ConvertRectToDIP(
31 const Layer* layer,
32 const gfx::Rect& rect_in_pixel);
33 COMPOSITOR_EXPORT gfx::Point ConvertPointToPixel(
34 const Layer* layer,
35 const gfx::Point& point_in_dip);
36 COMPOSITOR_EXPORT gfx::Size ConvertSizeToPixel(
37 const Layer* layer,
38 const gfx::Size& size_in_dip);
39 COMPOSITOR_EXPORT gfx::Rect ConvertRectToPixel(
40 const Layer* layer,
41 const gfx::Rect& rect_in_dip);
43 } // namespace ui
45 #endif // UI_COMPOSITOR_DIP_UTIL_H_