| 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 | |
| 312 ::Cursor GetXCursor(int cursor_shape) { | 303 ::Cursor GetXCursor(int cursor_shape) { |
| 313 if (!cursor_cache) | 304 if (!cursor_cache) |
| 314 cursor_cache = new XCursorCache; | 305 cursor_cache = new XCursorCache; |
| 315 return cursor_cache->GetCursor(cursor_shape); | 306 return cursor_cache->GetCursor(cursor_shape); |
| 316 } | 307 } |
| 317 | 308 |
| 318 void ResetXCursorCache() { | 309 void ResetXCursorCache() { |
| 319 delete cursor_cache; | 310 delete cursor_cache; |
| 320 cursor_cache = NULL; | 311 cursor_cache = NULL; |
| 321 } | 312 } |
| (...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1357 << "request_code " << static_cast<int>(error_event.request_code) << ", " | 1348 << "request_code " << static_cast<int>(error_event.request_code) << ", " |
| 1358 << "minor_code " << static_cast<int>(error_event.minor_code) | 1349 << "minor_code " << static_cast<int>(error_event.minor_code) |
| 1359 << " (" << request_str << ")"; | 1350 << " (" << request_str << ")"; |
| 1360 } | 1351 } |
| 1361 | 1352 |
| 1362 // ---------------------------------------------------------------------------- | 1353 // ---------------------------------------------------------------------------- |
| 1363 // End of x11_util_internal.h | 1354 // End of x11_util_internal.h |
| 1364 | 1355 |
| 1365 | 1356 |
| 1366 } // namespace ui | 1357 } // namespace ui |
| OLD | NEW |