| 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_change_observer_x11.h" | 5 #include "ash/display/display_change_observer_x11.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 int64 id = GetDisplayId(output, output_index); | 189 int64 id = GetDisplayId(output, output_index); |
| 190 | 190 |
| 191 // If ID is invalid or there is an duplicate, just use output index. | 191 // If ID is invalid or there is an duplicate, just use output index. |
| 192 if (id == gfx::Display::kInvalidDisplayID || ids.find(id) != ids.end()) | 192 if (id == gfx::Display::kInvalidDisplayID || ids.find(id) != ids.end()) |
| 193 id = output_index; | 193 id = output_index; |
| 194 ids.insert(id); | 194 ids.insert(id); |
| 195 | 195 |
| 196 displays.push_back(DisplayInfo(id, name, has_overscan)); | 196 displays.push_back(DisplayInfo(id, name, has_overscan)); |
| 197 displays.back().set_device_scale_factor(device_scale_factor); | 197 displays.back().set_device_scale_factor(device_scale_factor); |
| 198 displays.back().SetBounds(display_bounds); | 198 displays.back().SetBounds(display_bounds); |
| 199 displays.back().set_native(true); |
| 199 } | 200 } |
| 200 | 201 |
| 201 // Free all allocated resources. | 202 // Free all allocated resources. |
| 202 for (std::map<XID, XRRCrtcInfo*>::const_iterator iter = crtc_info_map.begin(); | 203 for (std::map<XID, XRRCrtcInfo*>::const_iterator iter = crtc_info_map.begin(); |
| 203 iter != crtc_info_map.end(); ++iter) { | 204 iter != crtc_info_map.end(); ++iter) { |
| 204 XRRFreeCrtcInfo(iter->second); | 205 XRRFreeCrtcInfo(iter->second); |
| 205 } | 206 } |
| 206 XRRFreeScreenResources(screen_resources); | 207 XRRFreeScreenResources(screen_resources); |
| 207 | 208 |
| 208 // DisplayManager can be null during the boot. | 209 // DisplayManager can be null during the boot. |
| 209 Shell::GetInstance()->display_manager()->OnNativeDisplaysChanged(displays); | 210 Shell::GetInstance()->display_manager()->OnNativeDisplaysChanged(displays); |
| 210 } | 211 } |
| 211 | 212 |
| 212 } // namespace internal | 213 } // namespace internal |
| 213 } // namespace ash | 214 } // namespace ash |
| OLD | NEW |