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_manager.h" | 5 #include "ash/display/display_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <limits> | 9 #include <limits> |
10 #include <map> | 10 #include <map> |
(...skipping 767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 uint32_t metrics = display::DisplayObserver::DISPLAY_METRIC_BOUNDS | | 778 uint32_t metrics = display::DisplayObserver::DISPLAY_METRIC_BOUNDS | |
779 display::DisplayObserver::DISPLAY_METRIC_WORK_AREA; | 779 display::DisplayObserver::DISPLAY_METRIC_WORK_AREA; |
780 if (display_changes.find(updated_index) != display_changes.end()) | 780 if (display_changes.find(updated_index) != display_changes.end()) |
781 metrics |= display_changes[updated_index]; | 781 metrics |= display_changes[updated_index]; |
782 | 782 |
783 display_changes[updated_index] = metrics; | 783 display_changes[updated_index] = metrics; |
784 } | 784 } |
785 } | 785 } |
786 | 786 |
787 active_display_list_ = new_displays; | 787 active_display_list_ = new_displays; |
| 788 active_only_display_list_ = active_display_list_; |
788 | 789 |
789 RefreshFontParams(); | 790 RefreshFontParams(); |
790 base::AutoReset<bool> resetter(&change_display_upon_host_resize_, false); | 791 base::AutoReset<bool> resetter(&change_display_upon_host_resize_, false); |
791 | 792 |
792 int active_display_list_size = active_display_list_.size(); | 793 int active_display_list_size = active_display_list_.size(); |
| 794 is_updating_display_list_ = true; |
793 // Temporarily add displays to be removed because display object | 795 // Temporarily add displays to be removed because display object |
794 // being removed are accessed during shutting down the root. | 796 // being removed are accessed during shutting down the root. |
795 active_display_list_.insert(active_display_list_.end(), | 797 active_display_list_.insert(active_display_list_.end(), |
796 removed_displays.begin(), removed_displays.end()); | 798 removed_displays.begin(), removed_displays.end()); |
797 | 799 |
798 for (const auto& display : removed_displays) | 800 for (const auto& display : removed_displays) |
799 screen_->NotifyDisplayRemoved(display); | 801 screen_->NotifyDisplayRemoved(display); |
800 | 802 |
801 for (size_t index : added_display_indices) | 803 for (size_t index : added_display_indices) |
802 screen_->NotifyDisplayAdded(active_display_list_[index]); | 804 screen_->NotifyDisplayAdded(active_display_list_[index]); |
803 | 805 |
804 active_display_list_.resize(active_display_list_size); | 806 active_display_list_.resize(active_display_list_size); |
| 807 is_updating_display_list_ = false; |
805 | 808 |
806 bool notify_primary_change = | 809 bool notify_primary_change = |
807 delegate_ ? old_primary.id() != screen_->GetPrimaryDisplay().id() : false; | 810 delegate_ ? old_primary.id() != screen_->GetPrimaryDisplay().id() : false; |
808 | 811 |
809 for (std::map<size_t, uint32_t>::iterator iter = display_changes.begin(); | 812 for (std::map<size_t, uint32_t>::iterator iter = display_changes.begin(); |
810 iter != display_changes.end(); ++iter) { | 813 iter != display_changes.end(); ++iter) { |
811 uint32_t metrics = iter->second; | 814 uint32_t metrics = iter->second; |
812 const display::Display& updated_display = active_display_list_[iter->first]; | 815 const display::Display& updated_display = active_display_list_[iter->first]; |
813 | 816 |
814 if (notify_primary_change && | 817 if (notify_primary_change && |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1349 layout.ApplyToDisplayList(display_list, updated_ids, | 1352 layout.ApplyToDisplayList(display_list, updated_ids, |
1350 kMinimumOverlapForInvalidOffset); | 1353 kMinimumOverlapForInvalidOffset); |
1351 } | 1354 } |
1352 | 1355 |
1353 void DisplayManager::RunPendingTasksForTest() { | 1356 void DisplayManager::RunPendingTasksForTest() { |
1354 if (!software_mirroring_display_list_.empty()) | 1357 if (!software_mirroring_display_list_.empty()) |
1355 base::RunLoop().RunUntilIdle(); | 1358 base::RunLoop().RunUntilIdle(); |
1356 } | 1359 } |
1357 | 1360 |
1358 } // namespace ash | 1361 } // namespace ash |
OLD | NEW |