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

Unified Diff: services/ui/display/platform_screen_ozone.h

Issue 2356913002: Pass device scale factor from display to ws. (Closed)
Patch Set: Created 4 years, 3 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
Index: services/ui/display/platform_screen_ozone.h
diff --git a/services/ui/display/platform_screen_ozone.h b/services/ui/display/platform_screen_ozone.h
index 88d2482227fd92521309e2492cf01cb583e317bc..b1ff23990d9dce2a74ee724399bca94e54a43f4e 100644
--- a/services/ui/display/platform_screen_ozone.h
+++ b/services/ui/display/platform_screen_ozone.h
@@ -47,12 +47,13 @@ class PlatformScreenOzone
// TODO(kylechar): This struct is just temporary until we migrate
// DisplayManager code out of ash so it can be used here.
struct DisplayInfo {
- DisplayInfo(int64_t new_id, const gfx::Rect& new_bounds)
- : id(new_id), bounds(new_bounds) {}
-
- int64_t id;
- // The display bounds.
+ int64_t id = Display::kInvalidDisplayID;
+ // The display bounds in DIP.
gfx::Rect bounds;
+ // Display size in DDP.
+ gfx::Size pixel_size;
+ // The display scale factor, either 1 or 2.
rjkroege 2016/09/21 13:23:47 not so. it can be 1.25 yes? And same blither abou
kylechar 2016/09/21 16:31:13 It can sort of be 1.25. It's hard to explain witho
+ float scale_factor = 1.0f;
// The display bounds have been modified and delegate should be updated.
bool modified = false;
// The display has been removed and delegate should be updated.
@@ -90,6 +91,9 @@ class PlatformScreenOzone
// iterator if there is no display with that id.
CachedDisplayIterator GetCachedDisplayIterator(int64_t display_id);
+ // Converts |snapshot| into a DisplayInfo.
+ DisplayInfo DisplayInfoFromSnapshot(ui::DisplaySnapshot* snapshot);
+
// ui::DisplayConfigurator::Observer:
void OnDisplayModeChanged(
const ui::DisplayConfigurator::DisplayStateList& displays) override;

Powered by Google App Engine
This is Rietveld 408576698