| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_util_x11.h" | 5 #include "ash/display/display_util_x11.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <X11/extensions/Xrandr.h> | 9 #include <X11/extensions/Xrandr.h> |
| 10 | 10 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 | 56 |
| 57 std::vector<Resolution> GetResolutionList( | 57 std::vector<Resolution> GetResolutionList( |
| 58 XRRScreenResources* screen_resources, | 58 XRRScreenResources* screen_resources, |
| 59 XRROutputInfo* output_info) { | 59 XRROutputInfo* output_info) { |
| 60 typedef std::map<std::pair<int,int>, Resolution> ResolutionMap; | 60 typedef std::map<std::pair<int,int>, Resolution> ResolutionMap; |
| 61 | 61 |
| 62 ResolutionMap resolution_map; | 62 ResolutionMap resolution_map; |
| 63 | 63 |
| 64 for (int i = 0; i < output_info->nmode; i++) { | 64 for (int i = 0; i < output_info->nmode; i++) { |
| 65 RRMode mode = output_info->modes[i]; | 65 RRMode mode = output_info->modes[i]; |
| 66 const XRRModeInfo* info = chromeos::FindModeInfo(screen_resources, mode); | 66 const XRRModeInfo* info = chromeos::FindXRRModeInfo(screen_resources, mode); |
| 67 DCHECK(info); | 67 DCHECK(info); |
| 68 // Just ignore bad entry on Release build. | 68 // Just ignore bad entry on Release build. |
| 69 if (!info) | 69 if (!info) |
| 70 continue; | 70 continue; |
| 71 ResolutionMap::key_type size = std::make_pair(info->width, info->height); | 71 ResolutionMap::key_type size = std::make_pair(info->width, info->height); |
| 72 bool interlaced = (info->modeFlags & RR_Interlace) != 0; | 72 bool interlaced = (info->modeFlags & RR_Interlace) != 0; |
| 73 | 73 |
| 74 ResolutionMap::iterator iter = resolution_map.find(size); | 74 ResolutionMap::iterator iter = resolution_map.find(size); |
| 75 | 75 |
| 76 // Add new resolution if it's new size or override interlaced mode. | 76 // Add new resolution if it's new size or override interlaced mode. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 88 iter != resolution_map.end(); | 88 iter != resolution_map.end(); |
| 89 ++iter) { | 89 ++iter) { |
| 90 resolution_list.push_back(iter->second); | 90 resolution_list.push_back(iter->second); |
| 91 } | 91 } |
| 92 std::sort(resolution_list.begin(), resolution_list.end(), ResolutionSorter()); | 92 std::sort(resolution_list.begin(), resolution_list.end(), ResolutionSorter()); |
| 93 return resolution_list; | 93 return resolution_list; |
| 94 } | 94 } |
| 95 | 95 |
| 96 } // namespace internal | 96 } // namespace internal |
| 97 } // namespace ash | 97 } // namespace ash |
| OLD | NEW |