OLD | NEW |
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 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
690 internal::RootWindowController* controller = | 690 internal::RootWindowController* controller = |
691 GetRootWindowController(root_to_delete); | 691 GetRootWindowController(root_to_delete); |
692 DCHECK(controller); | 692 DCHECK(controller); |
693 controller->MoveWindowsTo(GetPrimaryRootWindow()); | 693 controller->MoveWindowsTo(GetPrimaryRootWindow()); |
694 // Delete most of root window related objects, but don't delete | 694 // Delete most of root window related objects, but don't delete |
695 // root window itself yet because the stack may be using it. | 695 // root window itself yet because the stack may be using it. |
696 controller->Shutdown(); | 696 controller->Shutdown(); |
697 base::MessageLoop::current()->DeleteSoon(FROM_HERE, controller); | 697 base::MessageLoop::current()->DeleteSoon(FROM_HERE, controller); |
698 } | 698 } |
699 | 699 |
| 700 ui::Compositor* DisplayController::GetCompositorForDisplay( |
| 701 const gfx::Display& display) { |
| 702 aura::RootWindow* root_window = GetRootWindowForDisplayId(display.id()); |
| 703 return root_window ? root_window->compositor() : NULL; |
| 704 } |
| 705 |
700 void DisplayController::OnRootWindowHostResized(const aura::RootWindow* root) { | 706 void DisplayController::OnRootWindowHostResized(const aura::RootWindow* root) { |
701 internal::DisplayManager* display_manager = GetDisplayManager(); | 707 internal::DisplayManager* display_manager = GetDisplayManager(); |
702 gfx::Display display = GetDisplayNearestWindow(root); | 708 gfx::Display display = GetDisplayNearestWindow(root); |
703 if (display_manager->UpdateDisplayBounds( | 709 if (display_manager->UpdateDisplayBounds( |
704 display.id(), | 710 display.id(), |
705 gfx::Rect(root->GetHostOrigin(), root->GetHostSize()))) { | 711 gfx::Rect(root->GetHostOrigin(), root->GetHostSize()))) { |
706 mirror_window_controller_->UpdateWindow(); | 712 mirror_window_controller_->UpdateWindow(); |
707 } | 713 } |
708 } | 714 } |
709 | 715 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
825 for (size_t i = 0; i < root_windows.size(); ++i) { | 831 for (size_t i = 0; i < root_windows.size(); ++i) { |
826 std::string name = | 832 std::string name = |
827 root_windows[i] == primary ? "aura_root_0" : "aura_root_x"; | 833 root_windows[i] == primary ? "aura_root_0" : "aura_root_x"; |
828 gfx::AcceleratedWidget xwindow = root_windows[i]->GetAcceleratedWidget(); | 834 gfx::AcceleratedWidget xwindow = root_windows[i]->GetAcceleratedWidget(); |
829 XStoreName(ui::GetXDisplay(), xwindow, name.c_str()); | 835 XStoreName(ui::GetXDisplay(), xwindow, name.c_str()); |
830 } | 836 } |
831 #endif | 837 #endif |
832 } | 838 } |
833 | 839 |
834 } // namespace ash | 840 } // namespace ash |
OLD | NEW |