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

Side by Side Diff: ui/display/util/x11/edid_parser_x11.cc

Issue 2924343002: Move ui::GetAtom to gfx::GetAtom (Closed)
Patch Set: fix CrOs build Created 3 years, 6 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ui/display/util/x11/edid_parser_x11.h" 5 #include "ui/display/util/x11/edid_parser_x11.h"
6 6
7 #include <X11/extensions/Xrandr.h> 7 #include <X11/extensions/Xrandr.h>
8 #include <X11/Xatom.h> 8 #include <X11/Xatom.h>
9 #include <X11/Xlib.h> 9 #include <X11/Xlib.h>
10 10
(...skipping 16 matching lines...) Expand all
27 27
28 // Get the EDID data from the |output| and stores to |edid|. 28 // Get the EDID data from the |output| and stores to |edid|.
29 // Returns true if EDID property is successfully obtained. Otherwise returns 29 // Returns true if EDID property is successfully obtained. Otherwise returns
30 // false and does not touch |edid|. 30 // false and does not touch |edid|.
31 bool GetEDIDProperty(XID output, std::vector<uint8_t>* edid) { 31 bool GetEDIDProperty(XID output, std::vector<uint8_t>* edid) {
32 if (!IsRandRAvailable()) 32 if (!IsRandRAvailable())
33 return false; 33 return false;
34 34
35 Display* display = gfx::GetXDisplay(); 35 Display* display = gfx::GetXDisplay();
36 36
37 static Atom edid_property = 37 Atom edid_property = gfx::GetAtom(RR_PROPERTY_RANDR_EDID);
38 ui::X11AtomCache::GetInstance()->GetAtom(RR_PROPERTY_RANDR_EDID);
39 38
40 bool has_edid_property = false; 39 bool has_edid_property = false;
41 int num_properties = 0; 40 int num_properties = 0;
42 gfx::XScopedPtr<Atom[]> properties( 41 gfx::XScopedPtr<Atom[]> properties(
43 XRRListOutputProperties(display, output, &num_properties)); 42 XRRListOutputProperties(display, output, &num_properties));
44 for (int i = 0; i < num_properties; ++i) { 43 for (int i = 0; i < num_properties; ++i) {
45 if (properties[i] == edid_property) { 44 if (properties[i] == edid_property) {
46 has_edid_property = true; 45 has_edid_property = true;
47 break; 46 break;
48 } 47 }
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 } 99 }
101 100
102 bool EDIDParserX11::GetOutputOverscanFlag(bool* out_flag) const { 101 bool EDIDParserX11::GetOutputOverscanFlag(bool* out_flag) const {
103 if (edid_.empty()) 102 if (edid_.empty())
104 return false; 103 return false;
105 104
106 return ParseOutputOverscanFlag(edid_, out_flag); 105 return ParseOutputOverscanFlag(edid_, out_flag);
107 } 106 }
108 107
109 } // namespace display 108 } // namespace display
OLDNEW
« no previous file with comments | « ui/display/manager/chromeos/x11/native_display_delegate_x11.cc ('k') | ui/events/devices/x11/device_data_manager_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698