Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Side by Side Diff: ash/display/display_util_x11.cc

Issue 22871010: chromeos: Include mode details in OutputSnapshot. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/display/display_change_observer_x11.cc ('k') | ash/display/output_configurator_animation.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ash/display/display_change_observer_x11.cc ('k') | ash/display/output_configurator_animation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698