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

Unified Diff: ui/gfx/win/screen_win_display.cc

Issue 1813493002: COMPLETED PREVIEW Migrate to Display Placement (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gfxmove
Patch Set: Created 4 years, 9 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/gfx/win/screen_win_display.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/win/screen_win_display.cc
diff --git a/ui/gfx/win/screen_win_display.cc b/ui/gfx/win/screen_win_display.cc
index 058adb19bd9d263622b64fe1d613ecd6aff43dfc..612bb01a84f657943c6aa91633a2dc4ed68270d9 100644
--- a/ui/gfx/win/screen_win_display.cc
+++ b/ui/gfx/win/screen_win_display.cc
@@ -7,7 +7,7 @@
#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/win/display_info.h"
#include "ui/gfx/win/dpi.h"
-#include "ui/gfx/win/rect_util.h"
+#include "ui/gfx/win/scaling_util.h"
namespace {
@@ -25,29 +25,6 @@ gfx::Display CreateDisplayFromDisplayInfo(
return display;
}
-gfx::Display CreateDisplayWithReferenceFromDisplayInfo(
- const gfx::win::ScreenWinDisplay& reference,
- const gfx::win::DisplayInfo& display_info) {
- gfx::Display display(display_info.id());
- float scale_factor = display_info.device_scale_factor();
- display.set_device_scale_factor(scale_factor);
- const gfx::Insets pixel_insets =
- display_info.screen_rect().InsetsFrom(display_info.screen_work_rect());
- const gfx::Insets scaled_insets = pixel_insets.Scale(1.0f / scale_factor,
- 1.0f / scale_factor);
- const gfx::Rect scaled_bounds =
- gfx::win::ScaleAndPositionRect(reference.display().bounds(),
- reference.pixel_bounds(),
- display_info.screen_rect(),
- scale_factor);
- display.set_bounds(scaled_bounds);
- gfx::Rect scaled_work_area(scaled_bounds);
- scaled_work_area.Inset(scaled_insets);
- display.set_work_area(scaled_work_area);
- display.set_rotation(display_info.rotation());
- return display;
-}
-
} // namespace
namespace gfx {
@@ -56,13 +33,12 @@ namespace win {
ScreenWinDisplay::ScreenWinDisplay() = default;
ScreenWinDisplay::ScreenWinDisplay(const DisplayInfo& display_info)
- : display_(CreateDisplayFromDisplayInfo(display_info)),
- pixel_bounds_(display_info.screen_rect()) {}
+ : ScreenWinDisplay(CreateDisplayFromDisplayInfo(display_info),
+ display_info) {}
-ScreenWinDisplay::ScreenWinDisplay(const ScreenWinDisplay& reference,
+ScreenWinDisplay::ScreenWinDisplay(const gfx::Display& display,
const DisplayInfo& display_info)
- : display_(CreateDisplayWithReferenceFromDisplayInfo(reference,
- display_info)),
+ : display_(display),
pixel_bounds_(display_info.screen_rect()) {}
} // namespace win
« no previous file with comments | « ui/gfx/win/screen_win_display.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698