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

Side by Side Diff: chrome/common/x11_util.h

Issue 27147: Linux: server side backing stores (Closed)
Patch Set: ... Created 11 years, 10 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
« no previous file with comments | « chrome/common/transport_dib_linux.cc ('k') | chrome/common/x11_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_COMMON_X11_UTIL_H_
6 #define CHROME_COMMON_X11_UTIL_H_
7
8 // This file declares utility functions for X11 (Linux only).
9 //
10 // These functions do not require the Xlib headers to be included (which is why
11 // we use a void* for Visual*). The Xlib headers are highly polluting so we try
12 // hard to limit their spread into the rest of the code.
13
14 typedef struct _GtkWidget GtkWidget;
15 typedef unsigned long XID;
16 typedef struct _XDisplay Display;
17
18 namespace gfx {
19 class Size;
20 }
21
22 namespace x11_util {
23 // These functions cache their results and must be called from the UI thread.
24 // Currently they don't support multiple screens/displays.
25
26 // Return an X11 connection for the current, primary display.
27 Display* GetXDisplay();
28 // Return true iff the connection supports X shared memory
29 bool QuerySharedMemorySupport(Display* dpy);
30
31 // These functions do not cache their results
32
33 // Get the X window id for the given GTK widget.
34 XID GetX11WindowFromGtkWidget(GtkWidget*);
35 // Get a Visual from the given widget. Since we don't include the Xlib
36 // headers, this is returned as a void*.
37 void* GetVisualFromGtkWidget(GtkWidget*);
38
39 // Return a handle to a server side pixmap. |shared_memory_key| is a SysV
40 // IPC key. The shared memory region must contain 32-bit pixels.
41 XID AttachSharedMemory(Display* display, int shared_memory_support);
42 void DetachSharedMemory(Display* display, XID shmseg);
43
44 // Return a handle to an XRender picture where |pixmap| is a handle to a
45 // pixmap containing Skia ARGB data.
46 XID CreatePictureFromSkiaPixmap(Display* display, XID pixmap);
47
48 void FreePicture(Display* display, XID picture);
49 void FreePixmap(Display* display, XID pixmap);
50 };
51
52 #endif // CHROME_COMMON_X11_UTIL_H_
OLDNEW
« no previous file with comments | « chrome/common/transport_dib_linux.cc ('k') | chrome/common/x11_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698