| Index: content/browser/renderer_host/dip_util.cc
|
| diff --git a/content/browser/renderer_host/dip_util.cc b/content/browser/renderer_host/dip_util.cc
|
| index 30490158a3ce0e0ccad4c99515bb6ebb0059b2f9..6952dd920af96309219389f79c6f49a797e9ac9c 100644
|
| --- a/content/browser/renderer_host/dip_util.cc
|
| +++ b/content/browser/renderer_host/dip_util.cc
|
| @@ -7,6 +7,7 @@
|
| #include "content/public/browser/render_widget_host_view.h"
|
| #include "ui/base/layout.h"
|
| #include "ui/gfx/display.h"
|
| +#include "ui/gfx/geometry/dip_util.h"
|
| #include "ui/gfx/point.h"
|
| #include "ui/gfx/point_conversions.h"
|
| #include "ui/gfx/rect.h"
|
| @@ -23,41 +24,17 @@ float GetScaleFactorForView(const RenderWidgetHostView* view) {
|
|
|
| gfx::Point ConvertViewPointToDIP(const RenderWidgetHostView* view,
|
| const gfx::Point& point_in_pixel) {
|
| - return gfx::ToFlooredPoint(
|
| - gfx::ScalePoint(point_in_pixel, 1.0f / GetScaleFactorForView(view)));
|
| + return gfx::ConvertPointToDIP(GetScaleFactorForView(view), point_in_pixel);
|
| }
|
|
|
| gfx::Size ConvertViewSizeToPixel(const RenderWidgetHostView* view,
|
| const gfx::Size& size_in_dip) {
|
| - return ConvertSizeToPixel(GetScaleFactorForView(view), size_in_dip);
|
| + return gfx::ConvertSizeToPixel(GetScaleFactorForView(view), size_in_dip);
|
| }
|
|
|
| gfx::Rect ConvertViewRectToPixel(const RenderWidgetHostView* view,
|
| const gfx::Rect& rect_in_dip) {
|
| - return ConvertRectToPixel(GetScaleFactorForView(view), rect_in_dip);
|
| -}
|
| -
|
| -gfx::Size ConvertSizeToDIP(float scale_factor,
|
| - const gfx::Size& size_in_pixel) {
|
| - return gfx::ToFlooredSize(
|
| - gfx::ScaleSize(size_in_pixel, 1.0f / scale_factor));
|
| -}
|
| -
|
| -gfx::Rect ConvertRectToDIP(float scale_factor,
|
| - const gfx::Rect& rect_in_pixel) {
|
| - return gfx::ToFlooredRectDeprecated(
|
| - gfx::ScaleRect(rect_in_pixel, 1.0f / scale_factor));
|
| -}
|
| -
|
| -gfx::Size ConvertSizeToPixel(float scale_factor,
|
| - const gfx::Size& size_in_dip) {
|
| - return gfx::ToFlooredSize(gfx::ScaleSize(size_in_dip, scale_factor));
|
| -}
|
| -
|
| -gfx::Rect ConvertRectToPixel(float scale_factor,
|
| - const gfx::Rect& rect_in_dip) {
|
| - return gfx::ToFlooredRectDeprecated(
|
| - gfx::ScaleRect(rect_in_dip, scale_factor));
|
| + return gfx::ConvertRectToPixel(GetScaleFactorForView(view), rect_in_dip);
|
| }
|
|
|
| } // namespace content
|
|
|