OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "ui/gfx/x/x11_types.h" | 5 #include "ui/gfx/x/x11_types.h" |
6 | 6 |
7 #include <X11/Xlib.h> | 7 #include <X11/Xlib.h> |
8 #include <xcb/xcb.h> | |
9 #include <X11/Xlib-xcb.h> | |
8 | 10 |
9 #include "base/command_line.h" | 11 #include "base/command_line.h" |
10 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
11 #include "build/build_config.h" | 13 #include "build/build_config.h" |
12 #include "ui/gfx/x/x11_switches.h" | 14 #include "ui/gfx/x/x11_switches.h" |
13 | 15 |
14 namespace gfx { | 16 namespace gfx { |
15 | 17 |
16 XDisplay* GetXDisplay() { | 18 XDisplay* GetXDisplay() { |
19 // TODO(thomasanderson): remove these symbol references once libxcb and | |
20 // libX11-xcb are used | |
21 asm volatile("" ::"r"(xcb_connect)); | |
Tom (Use chromium acct)
2016/08/03 19:42:16
Couldn't figure out a better way to do this
sadrul
2016/08/04 15:45:29
What does this do?
Tom (Use chromium acct)
2016/08/04 16:32:53
References symbols so we link against the shared l
| |
22 asm volatile("" ::"r"(XGetXCBConnection)); | |
17 static XDisplay* display = NULL; | 23 static XDisplay* display = NULL; |
18 if (!display) | 24 if (!display) |
19 display = OpenNewXDisplay(); | 25 display = OpenNewXDisplay(); |
20 return display; | 26 return display; |
21 } | 27 } |
22 | 28 |
23 XDisplay* OpenNewXDisplay() { | 29 XDisplay* OpenNewXDisplay() { |
24 #if defined(OS_CHROMEOS) | 30 #if defined(OS_CHROMEOS) |
25 return XOpenDisplay(NULL); | 31 return XOpenDisplay(NULL); |
26 #else | 32 #else |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
166 copy_width, copy_height); | 172 copy_width, copy_height); |
167 free(orig_bitmap16); | 173 free(orig_bitmap16); |
168 } else { | 174 } else { |
169 LOG(FATAL) << "Sorry, we don't support your visual depth without " | 175 LOG(FATAL) << "Sorry, we don't support your visual depth without " |
170 "Xrender support (depth:" << depth | 176 "Xrender support (depth:" << depth |
171 << " bpp:" << pixmap_bpp << ")"; | 177 << " bpp:" << pixmap_bpp << ")"; |
172 } | 178 } |
173 } | 179 } |
174 | 180 |
175 } // namespace gfx | 181 } // namespace gfx |
176 | |
Tom (Use chromium acct)
2016/08/03 19:42:16
emacs auto-saves the file like this
| |
OLD | NEW |