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

Unified Diff: ui/display/win/screen_win.cc

Issue 1889423002: Move Windows DPI Code from ui/gfx to ui/display (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a TODO Created 4 years, 8 months 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
« no previous file with comments | « ui/display/win/dpi.cc ('k') | ui/display/win/screen_win_display.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/display/win/screen_win.cc
diff --git a/ui/display/win/screen_win.cc b/ui/display/win/screen_win.cc
index 6e4423b080451114c2741284f86061bfd19149b8..6552936d05a51436df60913a0a1b15b104d6ccda 100644
--- a/ui/display/win/screen_win.cc
+++ b/ui/display/win/screen_win.cc
@@ -9,6 +9,7 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "ui/display/win/display_info.h"
+#include "ui/display/win/dpi.h"
#include "ui/display/win/screen_win_display.h"
#include "ui/gfx/display.h"
#include "ui/gfx/geometry/point.h"
@@ -16,7 +17,6 @@
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/rect_conversions.h"
#include "ui/gfx/geometry/size_conversions.h"
-#include "ui/gfx/win/dpi.h"
namespace display {
namespace win {
@@ -57,7 +57,7 @@ BOOL CALLBACK EnumMonitorCallback(HMONITOR monitor,
reinterpret_cast<std::vector<DisplayInfo>*>(data);
DCHECK(display_infos);
display_infos->push_back(DisplayInfo(MonitorInfoFromHMONITOR(monitor),
- gfx::GetDPIScale()));
+ GetDPIScale()));
return TRUE;
}
@@ -80,12 +80,12 @@ ScreenWin::~ScreenWin() = default;
// static
gfx::Point ScreenWin::ScreenToDIPPoint(const gfx::Point& pixel_point) {
- return ScaleToFlooredPoint(pixel_point, 1.0f / gfx::GetDPIScale());
+ return ScaleToFlooredPoint(pixel_point, 1.0f / GetDPIScale());
}
// static
gfx::Point ScreenWin::DIPToScreenPoint(const gfx::Point& dip_point) {
- return ScaleToFlooredPoint(dip_point, gfx::GetDPIScale());
+ return ScaleToFlooredPoint(dip_point, GetDPIScale());
}
// static
@@ -134,14 +134,14 @@ gfx::Size ScreenWin::ScreenToDIPSize(HWND hwnd,
const gfx::Size& size_in_pixels) {
// Always ceil sizes. Otherwise we may be leaving off part of the bounds.
// TODO(robliao): Get the scale factor from |hwnd|.
- return ScaleToCeiledSize(size_in_pixels, 1.0f / gfx::GetDPIScale());
+ return ScaleToCeiledSize(size_in_pixels, 1.0f / GetDPIScale());
}
// static
gfx::Size ScreenWin::DIPToScreenSize(HWND hwnd, const gfx::Size& dip_size) {
// Always ceil sizes. Otherwise we may be leaving off part of the bounds.
// TODO(robliao): Get the scale factor from |hwnd|.
- return ScaleToCeiledSize(dip_size, gfx::GetDPIScale());
+ return ScaleToCeiledSize(dip_size, GetDPIScale());
}
HWND ScreenWin::GetHWNDFromNativeView(gfx::NativeView window) const {
« no previous file with comments | « ui/display/win/dpi.cc ('k') | ui/display/win/screen_win_display.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698