OLD | NEW |
| (Empty) |
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. | |
4 | |
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_DIP_UTIL_H_ | |
6 #define CONTENT_BROWSER_RENDERER_HOST_DIP_UTIL_H_ | |
7 #pragma once | |
8 | |
9 #include "content/common/content_export.h" | |
10 | |
11 namespace gfx { | |
12 class Point; | |
13 class Rect; | |
14 class Size; | |
15 } // namespace gfx | |
16 | |
17 namespace content { | |
18 class RenderWidgetHostView; | |
19 | |
20 // Returns scale factor used to convert from DIP to pixel coordinate systems. | |
21 // Returns 1.0 if DIP is not enabled. | |
22 CONTENT_EXPORT float GetDIPScaleFactor(const RenderWidgetHostView* view); | |
23 | |
24 // Utility functions that convert point/size/rect between DIP and pixel | |
25 // coordinate system. | |
26 CONTENT_EXPORT gfx::Point ConvertPointToDIP(const RenderWidgetHostView* view, | |
27 const gfx::Point& point_in_pixel); | |
28 CONTENT_EXPORT gfx::Size ConvertSizeToDIP(const RenderWidgetHostView* view, | |
29 const gfx::Size& size_in_pixel); | |
30 CONTENT_EXPORT gfx::Rect ConvertRectToDIP(const RenderWidgetHostView* view, | |
31 const gfx::Rect& rect_in_pixel); | |
32 CONTENT_EXPORT gfx::Point ConvertPointToPixel(const RenderWidgetHostView* view, | |
33 const gfx::Point& point_in_dip); | |
34 CONTENT_EXPORT gfx::Size ConvertSizeToPixel(const RenderWidgetHostView* view, | |
35 const gfx::Size& size_in_dip); | |
36 CONTENT_EXPORT gfx::Rect ConvertRectToPixel(const RenderWidgetHostView* view, | |
37 const gfx::Rect& rect_in_dip); | |
38 } // namespace content | |
39 | |
40 #endif // CONTENT_BROWSER_RENDERER_HOST_DIP_UTIL_H_ | |
OLD | NEW |