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 // This file defines utility functions for X11 (Linux only). This code has been | 5 // This file defines utility functions for X11 (Linux only). This code has been |
6 // ported from XCB since we can't use XCB on Ubuntu while its 32-bit support | 6 // ported from XCB since we can't use XCB on Ubuntu while its 32-bit support |
7 // remains woefully incomplete. | 7 // remains woefully incomplete. |
8 | 8 |
9 #include "ui/base/x/x11_util.h" | 9 #include "ui/base/x/x11_util.h" |
10 | 10 |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 | 293 |
294 if (shared_memory_support_cached) | 294 if (shared_memory_support_cached) |
295 return shared_memory_support; | 295 return shared_memory_support; |
296 | 296 |
297 shared_memory_support = DoQuerySharedMemorySupport(dpy); | 297 shared_memory_support = DoQuerySharedMemorySupport(dpy); |
298 shared_memory_support_cached = true; | 298 shared_memory_support_cached = true; |
299 | 299 |
300 return shared_memory_support; | 300 return shared_memory_support; |
301 } | 301 } |
302 | 302 |
| 303 bool QueryRenderSupport(Display* dpy) { |
| 304 int dummy; |
| 305 // We don't care about the version of Xrender since all the features which |
| 306 // we use are included in every version. |
| 307 static bool render_supported = XRenderQueryExtension(dpy, &dummy, &dummy); |
| 308 |
| 309 return render_supported; |
| 310 } |
| 311 |
303 ::Cursor GetXCursor(int cursor_shape) { | 312 ::Cursor GetXCursor(int cursor_shape) { |
304 if (!cursor_cache) | 313 if (!cursor_cache) |
305 cursor_cache = new XCursorCache; | 314 cursor_cache = new XCursorCache; |
306 return cursor_cache->GetCursor(cursor_shape); | 315 return cursor_cache->GetCursor(cursor_shape); |
307 } | 316 } |
308 | 317 |
309 void ResetXCursorCache() { | 318 void ResetXCursorCache() { |
310 delete cursor_cache; | 319 delete cursor_cache; |
311 cursor_cache = NULL; | 320 cursor_cache = NULL; |
312 } | 321 } |
(...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1348 << "request_code " << static_cast<int>(error_event.request_code) << ", " | 1357 << "request_code " << static_cast<int>(error_event.request_code) << ", " |
1349 << "minor_code " << static_cast<int>(error_event.minor_code) | 1358 << "minor_code " << static_cast<int>(error_event.minor_code) |
1350 << " (" << request_str << ")"; | 1359 << " (" << request_str << ")"; |
1351 } | 1360 } |
1352 | 1361 |
1353 // ---------------------------------------------------------------------------- | 1362 // ---------------------------------------------------------------------------- |
1354 // End of x11_util_internal.h | 1363 // End of x11_util_internal.h |
1355 | 1364 |
1356 | 1365 |
1357 } // namespace ui | 1366 } // namespace ui |
OLD | NEW |