| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "chrome/common/x11_util.h" | 9 #include "chrome/common/x11_util.h" |
| 10 #include "chrome/common/x11_util_internal.h" | 10 #include "chrome/common/x11_util_internal.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 | 75 |
| 76 if (shared_memory_support_cached) | 76 if (shared_memory_support_cached) |
| 77 return shared_memory_support; | 77 return shared_memory_support; |
| 78 | 78 |
| 79 shared_memory_support = DoQuerySharedMemorySupport(dpy); | 79 shared_memory_support = DoQuerySharedMemorySupport(dpy); |
| 80 shared_memory_support_cached = true; | 80 shared_memory_support_cached = true; |
| 81 | 81 |
| 82 return shared_memory_support; | 82 return shared_memory_support; |
| 83 } | 83 } |
| 84 | 84 |
| 85 XID GetX11RootWindow() { |
| 86 return GDK_WINDOW_XID(gdk_get_default_root_window()); |
| 87 } |
| 88 |
| 85 XID GetX11WindowFromGtkWidget(GtkWidget* widget) { | 89 XID GetX11WindowFromGtkWidget(GtkWidget* widget) { |
| 86 return GDK_WINDOW_XID(widget->window); | 90 return GDK_WINDOW_XID(widget->window); |
| 87 } | 91 } |
| 88 | 92 |
| 89 void* GetVisualFromGtkWidget(GtkWidget* widget) { | 93 void* GetVisualFromGtkWidget(GtkWidget* widget) { |
| 90 return GDK_VISUAL_XVISUAL(gtk_widget_get_visual(widget)); | 94 return GDK_VISUAL_XVISUAL(gtk_widget_get_visual(widget)); |
| 91 } | 95 } |
| 92 | 96 |
| 93 XRenderPictFormat* GetRenderVisualFormat(Display* dpy, Visual* visual) { | 97 XRenderPictFormat* GetRenderVisualFormat(Display* dpy, Visual* visual) { |
| 94 static XRenderPictFormat* pictformat = NULL; | 98 static XRenderPictFormat* pictformat = NULL; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 | 176 |
| 173 void FreePicture(Display* display, XID picture) { | 177 void FreePicture(Display* display, XID picture) { |
| 174 XRenderFreePicture(display, picture); | 178 XRenderFreePicture(display, picture); |
| 175 } | 179 } |
| 176 | 180 |
| 177 void FreePixmap(Display* display, XID pixmap) { | 181 void FreePixmap(Display* display, XID pixmap) { |
| 178 XFreePixmap(display, pixmap); | 182 XFreePixmap(display, pixmap); |
| 179 } | 183 } |
| 180 | 184 |
| 181 } // namespace x11_util | 185 } // namespace x11_util |
| OLD | NEW |