Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(721)

Unified Diff: ui/gfx/geometry/dip_util.cc

Issue 2447303002: Scale client area, hit test mask and bounds by device_scale_factor. (Closed)
Patch Set: sky@'s comments Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« ui/aura/mus/window_tree_client.cc ('K') | « ui/gfx/geometry/dip_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/geometry/dip_util.cc
diff --git a/ui/gfx/geometry/dip_util.cc b/ui/gfx/geometry/dip_util.cc
index c1efdf5e414f25e444796d104d1e1ceaf3971a96..20f626c871cb4c880e48ae08d9e244631a838edd 100644
--- a/ui/gfx/geometry/dip_util.cc
+++ b/ui/gfx/geometry/dip_util.cc
@@ -4,6 +4,7 @@
#include "ui/gfx/geometry/dip_util.h"
+#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/point_conversions.h"
#include "ui/gfx/geometry/point_f.h"
@@ -14,6 +15,11 @@
namespace gfx {
+Insets ConvertInsetsToDIP(float scale_factor,
+ const gfx::Insets& insets_in_pixel) {
+ return insets_in_pixel.Scale(1.0f / scale_factor);
+}
+
Point ConvertPointToDIP(float scale_factor, const Point& point_in_pixel) {
return ScaleToFlooredPoint(point_in_pixel, 1.0f / scale_factor);
}
@@ -31,6 +37,11 @@ Rect ConvertRectToDIP(float scale_factor, const Rect& rect_in_pixel) {
ScaleRect(RectF(rect_in_pixel), 1.0f / scale_factor));
}
+Insets ConvertInsetsToPixel(float scale_factor,
+ const gfx::Insets& insets_in_dip) {
+ return insets_in_dip.Scale(scale_factor);
+}
+
Point ConvertPointToPixel(float scale_factor, const Point& point_in_dip) {
return ScaleToFlooredPoint(point_in_dip, scale_factor);
}
« ui/aura/mus/window_tree_client.cc ('K') | « ui/gfx/geometry/dip_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698