Chromium Code Reviews| 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 // Invalidate ui_scale (and rotation) so that DisplayInfo::CopyFromNative | |
| 200 // ignores ui_scale and rotate value. | |
| 201 displays.back().set_ui_scale(0.0f); | |
|
Jun Mukai
2013/03/22 00:53:07
setting a scale to '0' sounds awful to me. Why not
oshima
2013/03/22 02:06:51
because 1.0f is valid scale. I understand that thi
| |
| 199 } | 202 } |
| 200 | 203 |
| 201 // Free all allocated resources. | 204 // Free all allocated resources. |
| 202 for (std::map<XID, XRRCrtcInfo*>::const_iterator iter = crtc_info_map.begin(); | 205 for (std::map<XID, XRRCrtcInfo*>::const_iterator iter = crtc_info_map.begin(); |
| 203 iter != crtc_info_map.end(); ++iter) { | 206 iter != crtc_info_map.end(); ++iter) { |
| 204 XRRFreeCrtcInfo(iter->second); | 207 XRRFreeCrtcInfo(iter->second); |
| 205 } | 208 } |
| 206 XRRFreeScreenResources(screen_resources); | 209 XRRFreeScreenResources(screen_resources); |
| 207 | 210 |
| 208 // DisplayManager can be null during the boot. | 211 // DisplayManager can be null during the boot. |
| 209 Shell::GetInstance()->display_manager()->OnNativeDisplaysChanged(displays); | 212 Shell::GetInstance()->display_manager()->OnNativeDisplaysChanged(displays); |
| 210 } | 213 } |
| 211 | 214 |
| 212 } // namespace internal | 215 } // namespace internal |
| 213 } // namespace ash | 216 } // namespace ash |
| OLD | NEW |