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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "services/ui/ws/display_manager.h" 5 #include "services/ui/ws/display_manager.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/trace_event/trace_event.h"
8 #include "services/ui/display/platform_screen.h" 9 #include "services/ui/display/platform_screen.h"
9 #include "services/ui/ws/display.h" 10 #include "services/ui/ws/display.h"
10 #include "services/ui/ws/display_binding.h" 11 #include "services/ui/ws/display_binding.h"
11 #include "services/ui/ws/event_dispatcher.h" 12 #include "services/ui/ws/event_dispatcher.h"
12 #include "services/ui/ws/platform_display_init_params.h" 13 #include "services/ui/ws/platform_display_init_params.h"
13 #include "services/ui/ws/server_window.h" 14 #include "services/ui/ws/server_window.h"
14 #include "services/ui/ws/user_display_manager.h" 15 #include "services/ui/ws/user_display_manager.h"
15 #include "services/ui/ws/user_display_manager_delegate.h" 16 #include "services/ui/ws/user_display_manager_delegate.h"
16 #include "services/ui/ws/user_id_tracker.h" 17 #include "services/ui/ws/user_id_tracker.h"
17 #include "services/ui/ws/window_manager_state.h" 18 #include "services/ui/ws/window_manager_state.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 ->mouse_pointer_last_location(); 160 ->mouse_pointer_last_location();
160 previous_window_manager_state->Deactivate(); 161 previous_window_manager_state->Deactivate();
161 } 162 }
162 163
163 WindowManagerState* current_window_manager_state = 164 WindowManagerState* current_window_manager_state =
164 window_server_->GetWindowManagerStateForUser(active_id); 165 window_server_->GetWindowManagerStateForUser(active_id);
165 if (current_window_manager_state) 166 if (current_window_manager_state)
166 current_window_manager_state->Activate(mouse_location_on_screen); 167 current_window_manager_state->Activate(mouse_location_on_screen);
167 } 168 }
168 169
169 void DisplayManager::OnDisplayAdded(int64_t id, const gfx::Rect& bounds) { 170 void DisplayManager::OnDisplayAdded(int64_t id,
171 const gfx::Rect& bounds,
172 const gfx::Size& pixel_size,
173 float scale_factor) {
174 TRACE_EVENT1("mus-ws", "OnDisplayAdded", "id", id);
170 PlatformDisplayInitParams params; 175 PlatformDisplayInitParams params;
171 params.display_bounds = bounds;
172 params.display_id = id; 176 params.display_id = id;
177 params.metrics.bounds = bounds;
178 params.metrics.pixel_size = pixel_size;
179 params.metrics.device_scale_factor = scale_factor;
173 params.surfaces_state = window_server_->GetSurfacesState(); 180 params.surfaces_state = window_server_->GetSurfacesState();
174 181
175 ws::Display* display = new ws::Display(window_server_, params); 182 ws::Display* display = new ws::Display(window_server_, params);
176 display->Init(nullptr); 183 display->Init(nullptr);
177 184
178 window_server_->delegate()->UpdateTouchTransforms(); 185 window_server_->delegate()->UpdateTouchTransforms();
179 } 186 }
180 187
181 void DisplayManager::OnDisplayRemoved(int64_t id) { 188 void DisplayManager::OnDisplayRemoved(int64_t id) {
189 TRACE_EVENT1("mus-ws", "OnDisplayRemoved", "id", id);
182 Display* display = GetDisplayById(id); 190 Display* display = GetDisplayById(id);
183 if (display) 191 if (display)
184 DestroyDisplay(display); 192 DestroyDisplay(display);
185 } 193 }
186 194
187 void DisplayManager::OnDisplayModified(int64_t id, const gfx::Rect& bounds) { 195 void DisplayManager::OnDisplayModified(int64_t id,
196 const gfx::Rect& bounds,
197 const gfx::Size& pixel_size,
198 float scale_factor) {
188 // TODO(kylechar): Implement. 199 // TODO(kylechar): Implement.
189 NOTREACHED(); 200 NOTREACHED();
190 } 201 }
191 202
192 } // namespace ws 203 } // namespace ws
193 } // namespace ui 204 } // namespace ui
OLDNEW
« 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