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

Unified Diff: services/ui/ws/display_manager.cc

Issue 2356913002: Pass device scale factor from display to ws. (Closed)
Patch Set: Fix more tests. 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
« no previous file with comments | « services/ui/ws/display_manager.h ('k') | services/ui/ws/frame_generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/ws/display_manager.cc
diff --git a/services/ui/ws/display_manager.cc b/services/ui/ws/display_manager.cc
index bcd520bd56c1749aa44a3cf33aa29fc8707a9d00..55a1d60da9d4a6ad8eea80655ccd6c4c21081b53 100644
--- a/services/ui/ws/display_manager.cc
+++ b/services/ui/ws/display_manager.cc
@@ -5,6 +5,7 @@
#include "services/ui/ws/display_manager.h"
#include "base/memory/ptr_util.h"
+#include "base/trace_event/trace_event.h"
#include "services/ui/display/platform_screen.h"
#include "services/ui/ws/display.h"
#include "services/ui/ws/display_binding.h"
@@ -166,10 +167,16 @@ void DisplayManager::OnActiveUserIdChanged(const UserId& previously_active_id,
current_window_manager_state->Activate(mouse_location_on_screen);
}
-void DisplayManager::OnDisplayAdded(int64_t id, const gfx::Rect& bounds) {
+void DisplayManager::OnDisplayAdded(int64_t id,
+ const gfx::Rect& bounds,
+ const gfx::Size& pixel_size,
+ float scale_factor) {
+ TRACE_EVENT1("mus-ws", "OnDisplayAdded", "id", id);
PlatformDisplayInitParams params;
- params.display_bounds = bounds;
params.display_id = id;
+ params.metrics.bounds = bounds;
+ params.metrics.pixel_size = pixel_size;
+ params.metrics.device_scale_factor = scale_factor;
params.surfaces_state = window_server_->GetSurfacesState();
ws::Display* display = new ws::Display(window_server_, params);
@@ -179,12 +186,16 @@ void DisplayManager::OnDisplayAdded(int64_t id, const gfx::Rect& bounds) {
}
void DisplayManager::OnDisplayRemoved(int64_t id) {
+ TRACE_EVENT1("mus-ws", "OnDisplayRemoved", "id", id);
Display* display = GetDisplayById(id);
if (display)
DestroyDisplay(display);
}
-void DisplayManager::OnDisplayModified(int64_t id, const gfx::Rect& bounds) {
+void DisplayManager::OnDisplayModified(int64_t id,
+ const gfx::Rect& bounds,
+ const gfx::Size& pixel_size,
+ float scale_factor) {
// TODO(kylechar): Implement.
NOTREACHED();
}
« no previous file with comments | « services/ui/ws/display_manager.h ('k') | services/ui/ws/frame_generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698