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

Side by Side Diff: ash/display/display_controller.cc

Issue 578553002: Use DSF instead of UI scale if the native DSF is 1.25 and UI Scale is 0.8x (dsf=1.25 equivalent) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 | « no previous file | ash/display/display_info.h » ('j') | ash/display/display_info.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ash/display/display_controller.h" 5 #include "ash/display/display_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <map> 9 #include <map>
10 10
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 // root window itself yet because the stack may be using it. 633 // root window itself yet because the stack may be using it.
634 controller->Shutdown(); 634 controller->Shutdown();
635 base::MessageLoop::current()->DeleteSoon(FROM_HERE, controller); 635 base::MessageLoop::current()->DeleteSoon(FROM_HERE, controller);
636 } 636 }
637 637
638 void DisplayController::OnDisplayMetricsChanged(const gfx::Display& display, 638 void DisplayController::OnDisplayMetricsChanged(const gfx::Display& display,
639 uint32_t metrics) { 639 uint32_t metrics) {
640 if (!(metrics & (DISPLAY_METRIC_BOUNDS | DISPLAY_METRIC_ROTATION | 640 if (!(metrics & (DISPLAY_METRIC_BOUNDS | DISPLAY_METRIC_ROTATION |
641 DISPLAY_METRIC_DEVICE_SCALE_FACTOR))) 641 DISPLAY_METRIC_DEVICE_SCALE_FACTOR)))
642 return; 642 return;
643
644 const DisplayInfo& display_info = 643 const DisplayInfo& display_info =
645 GetDisplayManager()->GetDisplayInfo(display.id()); 644 GetDisplayManager()->GetDisplayInfo(display.id());
646 DCHECK(!display_info.bounds_in_native().IsEmpty()); 645 DCHECK(!display_info.bounds_in_native().IsEmpty());
647 AshWindowTreeHost* ash_host = window_tree_hosts_[display.id()]; 646 AshWindowTreeHost* ash_host = window_tree_hosts_[display.id()];
648 ash_host->AsWindowTreeHost()->SetBounds(display_info.bounds_in_native()); 647 ash_host->AsWindowTreeHost()->SetBounds(display_info.bounds_in_native());
649 SetDisplayPropertiesOnHost(ash_host, display); 648 SetDisplayPropertiesOnHost(ash_host, display);
650 } 649 }
651 650
652 void DisplayController::OnHostResized(const aura::WindowTreeHost* host) { 651 void DisplayController::OnHostResized(const aura::WindowTreeHost* host) {
653 gfx::Display display = Shell::GetScreen()->GetDisplayNearestWindow( 652 gfx::Display display = Shell::GetScreen()->GetDisplayNearestWindow(
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 std::string name = 785 std::string name =
787 root_windows[i] == primary ? "aura_root_0" : "aura_root_x"; 786 root_windows[i] == primary ? "aura_root_0" : "aura_root_x";
788 gfx::AcceleratedWidget xwindow = 787 gfx::AcceleratedWidget xwindow =
789 root_windows[i]->GetHost()->GetAcceleratedWidget(); 788 root_windows[i]->GetHost()->GetAcceleratedWidget();
790 XStoreName(gfx::GetXDisplay(), xwindow, name.c_str()); 789 XStoreName(gfx::GetXDisplay(), xwindow, name.c_str());
791 } 790 }
792 #endif 791 #endif
793 } 792 }
794 793
795 } // namespace ash 794 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/display/display_info.h » ('j') | ash/display/display_info.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698