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

Side by Side Diff: services/ui/display/screen_manager_ozone_internal.cc

Issue 2736943003: Start to decouple display::Display from ws::PlatformDisplay. (Closed)
Patch Set: Fix comments. Created 3 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 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/display/screen_manager_ozone_internal.h" 5 #include "services/ui/display/screen_manager_ozone_internal.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 void ScreenManagerOzoneInternal::RelinquishDisplayControl( 301 void ScreenManagerOzoneInternal::RelinquishDisplayControl(
302 const RelinquishDisplayControlCallback& callback) { 302 const RelinquishDisplayControlCallback& callback) {
303 display_configurator_.RelinquishControl(callback); 303 display_configurator_.RelinquishControl(callback);
304 } 304 }
305 305
306 void ScreenManagerOzoneInternal::OnDisplayAdded(const Display& display) { 306 void ScreenManagerOzoneInternal::OnDisplayAdded(const Display& display) {
307 ViewportMetrics metrics = GetViewportMetricsForDisplay(display); 307 ViewportMetrics metrics = GetViewportMetricsForDisplay(display);
308 DVLOG(1) << "OnDisplayAdded: " << display.ToString() << "\n " 308 DVLOG(1) << "OnDisplayAdded: " << display.ToString() << "\n "
309 << metrics.ToString(); 309 << metrics.ToString();
310 screen_->display_list().AddDisplay(display, DisplayList::Type::NOT_PRIMARY); 310 screen_->display_list().AddDisplay(display, DisplayList::Type::NOT_PRIMARY);
311 delegate_->OnDisplayAdded(display.id(), metrics); 311 delegate_->OnDisplayAdded(display, metrics);
312 } 312 }
313 313
314 void ScreenManagerOzoneInternal::OnDisplayRemoved(const Display& display) { 314 void ScreenManagerOzoneInternal::OnDisplayRemoved(const Display& display) {
315 // TODO(kylechar): If we're removing the primary display we need to first set 315 // TODO(kylechar): If we're removing the primary display we need to first set
316 // a new primary display. This will crash until then. 316 // a new primary display. This will crash until then.
317 317
318 DVLOG(1) << "OnDisplayRemoved: " << display.ToString(); 318 DVLOG(1) << "OnDisplayRemoved: " << display.ToString();
319 screen_->display_list().RemoveDisplay(display.id()); 319 screen_->display_list().RemoveDisplay(display.id());
320 delegate_->OnDisplayRemoved(display.id()); 320 delegate_->OnDisplayRemoved(display.id());
321 } 321 }
322 322
323 void ScreenManagerOzoneInternal::OnDisplayMetricsChanged( 323 void ScreenManagerOzoneInternal::OnDisplayMetricsChanged(
324 const Display& display, 324 const Display& display,
325 uint32_t changed_metrics) { 325 uint32_t changed_metrics) {
326 ViewportMetrics metrics = GetViewportMetricsForDisplay(display); 326 ViewportMetrics metrics = GetViewportMetricsForDisplay(display);
327 DVLOG(1) << "OnDisplayModified: " << display.ToString() << "\n " 327 DVLOG(1) << "OnDisplayModified: " << display.ToString() << "\n "
328 << metrics.ToString(); 328 << metrics.ToString();
329 screen_->display_list().UpdateDisplay(display); 329 screen_->display_list().UpdateDisplay(display);
330 delegate_->OnDisplayModified(display.id(), metrics); 330 delegate_->OnDisplayModified(display, metrics);
331 } 331 }
332 332
333 ViewportMetrics ScreenManagerOzoneInternal::GetViewportMetricsForDisplay( 333 ViewportMetrics ScreenManagerOzoneInternal::GetViewportMetricsForDisplay(
334 const Display& display) { 334 const Display& display) {
335 const ManagedDisplayInfo& managed_info = 335 const ManagedDisplayInfo& managed_info =
336 display_manager_->GetDisplayInfo(display.id()); 336 display_manager_->GetDisplayInfo(display.id());
337 337
338 ViewportMetrics metrics; 338 ViewportMetrics metrics;
339 metrics.bounds = display.bounds(); 339 // TODO(kylechar): The origin of |metrics.bounds_in_pixels| should be updated
340 metrics.work_area = display.work_area(); 340 // so that PlatformWindows appear next to one another for multiple displays.
341 metrics.pixel_size = managed_info.bounds_in_native().size(); 341 metrics.bounds_in_pixels = managed_info.bounds_in_native();
342 metrics.rotation = display.rotation();
343 metrics.touch_support = display.touch_support();
344 metrics.device_scale_factor = display.device_scale_factor(); 342 metrics.device_scale_factor = display.device_scale_factor();
345 metrics.ui_scale_factor = managed_info.configured_ui_scale(); 343 metrics.ui_scale_factor = managed_info.configured_ui_scale();
346 344
347 return metrics; 345 return metrics;
348 } 346 }
349 347
350 void ScreenManagerOzoneInternal::CreateOrUpdateMirroringDisplay( 348 void ScreenManagerOzoneInternal::CreateOrUpdateMirroringDisplay(
351 const DisplayInfoList& display_info_list) { 349 const DisplayInfoList& display_info_list) {
352 NOTIMPLEMENTED(); 350 NOTIMPLEMENTED();
353 } 351 }
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 std::move(request)); 397 std::move(request));
400 } 398 }
401 399
402 void ScreenManagerOzoneInternal::Create( 400 void ScreenManagerOzoneInternal::Create(
403 const service_manager::Identity& remote_identity, 401 const service_manager::Identity& remote_identity,
404 mojom::TestDisplayControllerRequest request) { 402 mojom::TestDisplayControllerRequest request) {
405 test_bindings_.AddBinding(this, std::move(request)); 403 test_bindings_.AddBinding(this, std::move(request));
406 } 404 }
407 405
408 } // namespace display 406 } // namespace display
OLDNEW
« no previous file with comments | « services/ui/display/screen_manager_delegate.h ('k') | services/ui/display/screen_manager_ozone_internal_unittests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698