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

Side by Side Diff: services/ui/ws/display_manager.cc

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 unified diff | Download patch
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 "services/ui/display/platform_screen.h" 8 #include "services/ui/display/platform_screen.h"
9 #include "services/ui/ws/display.h" 9 #include "services/ui/ws/display.h"
10 #include "services/ui/ws/display_binding.h" 10 #include "services/ui/ws/display_binding.h"
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 ->mouse_pointer_last_location(); 159 ->mouse_pointer_last_location();
160 previous_window_manager_state->Deactivate(); 160 previous_window_manager_state->Deactivate();
161 } 161 }
162 162
163 WindowManagerState* current_window_manager_state = 163 WindowManagerState* current_window_manager_state =
164 window_server_->GetWindowManagerStateForUser(active_id); 164 window_server_->GetWindowManagerStateForUser(active_id);
165 if (current_window_manager_state) 165 if (current_window_manager_state)
166 current_window_manager_state->Activate(mouse_location_on_screen); 166 current_window_manager_state->Activate(mouse_location_on_screen);
167 } 167 }
168 168
169 void DisplayManager::OnDisplayAdded(int64_t id, const gfx::Rect& bounds) { 169 void DisplayManager::OnDisplayAdded(int64_t id,
170 const gfx::Rect& bounds,
171 const gfx::Size& pixel_size,
172 float scale_factor) {
173 LOG(ERROR) << "DisplayManager::OnDisplayAdded"
174 << "\n id=" << id << "\n bounds=" << bounds.ToString()
175 << "\n pixel_size=" << pixel_size.ToString()
176 << "\n scale_factor=" << scale_factor;
170 PlatformDisplayInitParams params; 177 PlatformDisplayInitParams params;
171 params.display_bounds = bounds;
172 params.display_id = id; 178 params.display_id = id;
179 params.metrics.bounds = bounds;
180 params.metrics.pixel_size = pixel_size;
181 params.metrics.device_scale_factor = scale_factor;
173 params.surfaces_state = window_server_->GetSurfacesState(); 182 params.surfaces_state = window_server_->GetSurfacesState();
174 183
175 ws::Display* display = new ws::Display(window_server_, params); 184 ws::Display* display = new ws::Display(window_server_, params);
176 display->Init(nullptr); 185 display->Init(nullptr);
177 186
178 window_server_->delegate()->UpdateTouchTransforms(); 187 window_server_->delegate()->UpdateTouchTransforms();
179 } 188 }
180 189
181 void DisplayManager::OnDisplayRemoved(int64_t id) { 190 void DisplayManager::OnDisplayRemoved(int64_t id) {
182 Display* display = GetDisplayById(id); 191 Display* display = GetDisplayById(id);
183 if (display) 192 if (display)
184 DestroyDisplay(display); 193 DestroyDisplay(display);
185 } 194 }
186 195
187 void DisplayManager::OnDisplayModified(int64_t id, const gfx::Rect& bounds) { 196 void DisplayManager::OnDisplayModified(int64_t id,
197 const gfx::Rect& bounds,
198 const gfx::Size& pixel_size,
199 float scale_factor) {
188 // TODO(kylechar): Implement. 200 // TODO(kylechar): Implement.
189 NOTREACHED(); 201 NOTREACHED();
190 } 202 }
191 203
192 } // namespace ws 204 } // namespace ws
193 } // namespace ui 205 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698