|
Lines 36-43
PlatformSharedResources* SharedX11Resources::m_staticSharedResource = 0;
Source/WebCore/platform/graphics/surfaces/glx/X11WindowResources.cpp_sec1
|
| 36 |
|
36 |
|
| 37 |
X11OffScreenWindow::X11OffScreenWindow() |
37 |
X11OffScreenWindow::X11OffScreenWindow() |
| 38 |
: GLPlatformSurface() |
38 |
: GLPlatformSurface() |
|
|
39 |
, m_sharedResources(0) |
| 39 |
{ |
40 |
{ |
| 40 |
m_sharedResources = PlatformSharedResources::create(); |
41 |
m_sharedResources = PlatformSharedResources::create(); |
|
|
42 |
|
| 43 |
if (!m_sharedResources) |
| 44 |
return; |
| 45 |
|
| 41 |
m_sharedDisplay = m_sharedResources->nativeDisplay(); |
46 |
m_sharedDisplay = m_sharedResources->nativeDisplay(); |
| 42 |
} |
47 |
} |
| 43 |
|
48 |
|
|
Lines 48-63
X11OffScreenWindow::~X11OffScreenWindow()
Source/WebCore/platform/graphics/surfaces/glx/X11WindowResources.cpp_sec2
|
| 48 |
void X11OffScreenWindow::setGeometry(const IntRect& newRect) |
53 |
void X11OffScreenWindow::setGeometry(const IntRect& newRect) |
| 49 |
{ |
54 |
{ |
| 50 |
GLPlatformSurface::setGeometry(newRect); |
55 |
GLPlatformSurface::setGeometry(newRect); |
| 51 |
XResizeWindow(m_sharedResources->x11Display(), m_drawable, newRect.width(), newRect.height()); |
56 |
XResizeWindow(m_sharedResources->x11Display(), m_bufferHandle, newRect.width(), newRect.height()); |
| 52 |
} |
57 |
} |
| 53 |
|
58 |
|
| 54 |
void X11OffScreenWindow::createOffscreenWindow() |
59 |
void X11OffScreenWindow::createOffscreenWindow() |
| 55 |
{ |
60 |
{ |
|
|
61 |
if (!m_sharedResources) |
| 62 |
return; |
| 63 |
|
| 56 |
Display* display = m_sharedResources->x11Display(); |
64 |
Display* display = m_sharedResources->x11Display(); |
| 57 |
if (!display) |
65 |
if (!display) |
| 58 |
return; |
66 |
return; |
| 59 |
|
67 |
|
| 60 |
GLXFBConfig config = m_sharedResources->surfaceContextConfig(); |
68 |
PlatformSurfaceConfig config = m_sharedResources->surfaceContextConfig(); |
| 61 |
|
69 |
|
| 62 |
if (!config) { |
70 |
if (!config) { |
| 63 |
LOG_ERROR("Failed to retrieve a valid configiration."); |
71 |
LOG_ERROR("Failed to retrieve a valid configiration."); |
|
Lines 80-112
void X11OffScreenWindow::createOffscreenWindow()
Source/WebCore/platform/graphics/surfaces/glx/X11WindowResources.cpp_sec3
|
| 80 |
attribute.background_pixel = WhitePixel(display, 0); |
88 |
attribute.background_pixel = WhitePixel(display, 0); |
| 81 |
attribute.border_pixel = BlackPixel(display, 0); |
89 |
attribute.border_pixel = BlackPixel(display, 0); |
| 82 |
attribute.colormap = cmap; |
90 |
attribute.colormap = cmap; |
| 83 |
m_drawable = XCreateWindow(display, xWindow, 0, 0, 1, 1, 0, visInfo->depth, InputOutput, visInfo->visual, CWBackPixel | CWBorderPixel | CWColormap, &attribute); |
91 |
m_bufferHandle = XCreateWindow(display, xWindow, 0, 0, 1, 1, 0, visInfo->depth, InputOutput, visInfo->visual, CWBackPixel | CWBorderPixel | CWColormap, &attribute); |
| 84 |
|
92 |
|
| 85 |
if (!m_drawable) { |
93 |
if (!m_bufferHandle) { |
| 86 |
LOG_ERROR("Failed to create offscreen window"); |
94 |
LOG_ERROR("Failed to create offscreen window"); |
| 87 |
return; |
95 |
return; |
| 88 |
} |
96 |
} |
| 89 |
|
97 |
|
| 90 |
XSetWindowBackgroundPixmap(display, m_drawable, 0); |
98 |
XSetWindowBackgroundPixmap(display, m_bufferHandle, 0); |
| 91 |
XCompositeRedirectWindow(display, m_drawable, CompositeRedirectManual); |
99 |
XCompositeRedirectWindow(display, m_bufferHandle, CompositeRedirectManual); |
| 92 |
|
100 |
|
| 93 |
if (m_sharedResources->isXRenderExtensionSupported()) |
101 |
if (m_sharedResources->isXRenderExtensionSupported()) |
| 94 |
XMapWindow(display, m_drawable); |
102 |
XMapWindow(display, m_bufferHandle); |
| 95 |
|
103 |
|
| 96 |
} |
104 |
} |
| 97 |
|
105 |
|
| 98 |
void X11OffScreenWindow::destroyWindow() |
106 |
void X11OffScreenWindow::destroyWindow() |
| 99 |
{ |
107 |
{ |
| 100 |
if (!m_drawable) |
108 |
if (!m_bufferHandle) |
| 101 |
return; |
109 |
return; |
| 102 |
|
110 |
|
| 103 |
GLPlatformSurface::destroy(); |
111 |
GLPlatformSurface::destroy(); |
| 104 |
Display* display = sharedDisplay(); |
112 |
Display* display = m_sharedResources->x11Display(); |
| 105 |
if (!display) |
113 |
if (!display) |
| 106 |
return; |
114 |
return; |
| 107 |
|
115 |
|
| 108 |
XDestroyWindow(display, m_drawable); |
116 |
XDestroyWindow(display, m_bufferHandle); |
| 109 |
m_drawable = 0; |
117 |
m_bufferHandle = 0; |
| 110 |
} |
118 |
} |
| 111 |
|
119 |
|
| 112 |
} |
120 |
} |