| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_COMPOSITOR_DIP_UTIL_H_ | 5 #ifndef UI_COMPOSITOR_DIP_UTIL_H_ |
| 6 #define UI_COMPOSITOR_DIP_UTIL_H_ | 6 #define UI_COMPOSITOR_DIP_UTIL_H_ |
| 7 | 7 |
| 8 #include "ui/compositor/compositor_export.h" | 8 #include "ui/compositor/compositor_export.h" |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "ui/gfx/point_f.h" |
| 10 | 11 |
| 11 namespace gfx { | 12 namespace gfx { |
| 12 class Point; | 13 class Point; |
| 13 class Size; | 14 class Size; |
| 14 class Rect; | 15 class Rect; |
| 15 } // namespace gfx | 16 } // namespace gfx |
| 16 | 17 |
| 17 namespace ui { | 18 namespace ui { |
| 18 class Layer; | 19 class Layer; |
| 19 | 20 |
| 20 COMPOSITOR_EXPORT float GetDeviceScaleFactor(const Layer* layer); | 21 COMPOSITOR_EXPORT float GetDeviceScaleFactor(const Layer* layer); |
| 21 | 22 |
| 22 // Utility functions that convert point/size/rect between | 23 // Utility functions that convert point/size/rect between |
| 23 // DIP and pixel coordinates system. | 24 // DIP and pixel coordinates system. |
| 24 COMPOSITOR_EXPORT gfx::Point ConvertPointToDIP( | 25 COMPOSITOR_EXPORT gfx::Point ConvertPointToDIP( |
| 25 const Layer* layer, | 26 const Layer* layer, |
| 26 const gfx::Point& point_in_pixel); | 27 const gfx::Point& point_in_pixel); |
| 28 COMPOSITOR_EXPORT gfx::PointF ConvertPointToDIP( |
| 29 const Layer* layer, |
| 30 const gfx::PointF& point_in_pixel); |
| 27 COMPOSITOR_EXPORT gfx::Size ConvertSizeToDIP( | 31 COMPOSITOR_EXPORT gfx::Size ConvertSizeToDIP( |
| 28 const Layer* layer, | 32 const Layer* layer, |
| 29 const gfx::Size& size_in_pixel); | 33 const gfx::Size& size_in_pixel); |
| 30 COMPOSITOR_EXPORT gfx::Rect ConvertRectToDIP( | 34 COMPOSITOR_EXPORT gfx::Rect ConvertRectToDIP( |
| 31 const Layer* layer, | 35 const Layer* layer, |
| 32 const gfx::Rect& rect_in_pixel); | 36 const gfx::Rect& rect_in_pixel); |
| 33 COMPOSITOR_EXPORT gfx::Point ConvertPointToPixel( | 37 COMPOSITOR_EXPORT gfx::Point ConvertPointToPixel( |
| 34 const Layer* layer, | 38 const Layer* layer, |
| 35 const gfx::Point& point_in_dip); | 39 const gfx::Point& point_in_dip); |
| 36 COMPOSITOR_EXPORT gfx::Size ConvertSizeToPixel( | 40 COMPOSITOR_EXPORT gfx::Size ConvertSizeToPixel( |
| 37 const Layer* layer, | 41 const Layer* layer, |
| 38 const gfx::Size& size_in_dip); | 42 const gfx::Size& size_in_dip); |
| 39 COMPOSITOR_EXPORT gfx::Rect ConvertRectToPixel( | 43 COMPOSITOR_EXPORT gfx::Rect ConvertRectToPixel( |
| 40 const Layer* layer, | 44 const Layer* layer, |
| 41 const gfx::Rect& rect_in_dip); | 45 const gfx::Rect& rect_in_dip); |
| 42 | 46 |
| 43 } // namespace ui | 47 } // namespace ui |
| 44 | 48 |
| 45 #endif // UI_COMPOSITOR_DIP_UTIL_H_ | 49 #endif // UI_COMPOSITOR_DIP_UTIL_H_ |
| OLD | NEW |