|
Lines 168-174
struct GraphicsSurfacePrivate {
a/Source/WebCore/platform/graphics/surfaces/glx/GraphicsSurfaceGLX.cpp_sec1
|
| 168 |
GLXFBConfig* fbConfigs = glXChooseFBConfig(m_display, DefaultScreen(m_display), attributes, &numReturned); |
168 |
GLXFBConfig* fbConfigs = glXChooseFBConfig(m_display, DefaultScreen(m_display), attributes, &numReturned); |
| 169 |
|
169 |
|
| 170 |
// Make sure that we choose a configuration that supports an alpha mask. |
170 |
// Make sure that we choose a configuration that supports an alpha mask. |
| 171 |
m_fbConfig = findFBConfigWithAlpha(fbConfigs, numReturned); |
171 |
for (int i = 0; i < numReturned; ++i) { |
|
|
172 |
XVisualInfo* visualInfo = glXGetVisualFromFBConfig(m_display, fbConfigs[i]); |
| 173 |
if (!visualInfo) |
| 174 |
continue; |
| 175 |
|
| 176 |
XRenderPictFormat* format = XRenderFindVisualFormat(m_display, visualInfo->visual); |
| 177 |
if (format && format->direct.alphaMask > 0) { |
| 178 |
m_fbConfig = fbConfigs[i]; |
| 179 |
break; |
| 180 |
} |
| 181 |
} |
| 172 |
|
182 |
|
| 173 |
XFree(fbConfigs); |
183 |
XFree(fbConfigs); |
| 174 |
|
184 |
|
|
Lines 245-255
struct GraphicsSurfacePrivate {
a/Source/WebCore/platform/graphics/surfaces/glx/GraphicsSurfaceGLX.cpp_sec2
|
| 245 |
int numberOfConfigs; |
255 |
int numberOfConfigs; |
| 246 |
GLXFBConfig* configs = glXChooseFBConfig(m_display, XDefaultScreen(m_display), glxSpec, &numberOfConfigs); |
256 |
GLXFBConfig* configs = glXChooseFBConfig(m_display, XDefaultScreen(m_display), glxSpec, &numberOfConfigs); |
| 247 |
|
257 |
|
| 248 |
// If origin window has alpha then try to find config with alpha. |
|
|
| 249 |
GLXFBConfig& config = m_hasAlpha ? findFBConfigWithAlpha(configs, numberOfConfigs) : configs[0]; |
| 250 |
|
| 251 |
m_xPixmap = XCompositeNameWindowPixmap(m_display, winId); |
258 |
m_xPixmap = XCompositeNameWindowPixmap(m_display, winId); |
| 252 |
m_glxPixmap = glXCreatePixmap(m_display, config, m_xPixmap, glxAttributes); |
259 |
m_glxPixmap = glXCreatePixmap(m_display, *configs, m_xPixmap, glxAttributes); |
| 253 |
|
260 |
|
| 254 |
uint inverted = 0; |
261 |
uint inverted = 0; |
| 255 |
glXQueryDrawable(m_display, m_glxPixmap, GLX_Y_INVERTED_EXT, &inverted); |
262 |
glXQueryDrawable(m_display, m_glxPixmap, GLX_Y_INVERTED_EXT, &inverted); |
|
Lines 347-372
struct GraphicsSurfacePrivate {
a/Source/WebCore/platform/graphics/surfaces/glx/GraphicsSurfaceGLX.cpp_sec3
|
| 347 |
return m_size; |
354 |
return m_size; |
| 348 |
} |
355 |
} |
| 349 |
|
356 |
|
| 350 |
bool isReceiver() const { return m_isReceiver; } |
|
|
| 351 |
private: |
357 |
private: |
| 352 |
GLXFBConfig& findFBConfigWithAlpha(GLXFBConfig* fbConfigs, int numberOfConfigs) |
|
|
| 353 |
{ |
| 354 |
for (int i = 0; i < numberOfConfigs; ++i) { |
| 355 |
XVisualInfo* visualInfo = glXGetVisualFromFBConfig(m_display, fbConfigs[i]); |
| 356 |
if (!visualInfo) |
| 357 |
continue; |
| 358 |
|
| 359 |
XRenderPictFormat* format = XRenderFindVisualFormat(m_display, visualInfo->visual); |
| 360 |
if (format && format->direct.alphaMask > 0) { |
| 361 |
return fbConfigs[i]; |
| 362 |
break; |
| 363 |
} |
| 364 |
} |
| 365 |
|
| 366 |
// Return 1st config as a fallback. |
| 367 |
return fbConfigs[0]; |
| 368 |
} |
| 369 |
|
| 370 |
OffScreenRootWindow m_offScreenWindow; |
358 |
OffScreenRootWindow m_offScreenWindow; |
| 371 |
IntSize m_size; |
359 |
IntSize m_size; |
| 372 |
Display* m_display; |
360 |
Display* m_display; |
|
Lines 449-462
uint32_t GraphicsSurface::platformFrontBuffer() const
a/Source/WebCore/platform/graphics/surfaces/glx/GraphicsSurfaceGLX.cpp_sec4
|
| 449 |
|
437 |
|
| 450 |
uint32_t GraphicsSurface::platformSwapBuffers() |
438 |
uint32_t GraphicsSurface::platformSwapBuffers() |
| 451 |
{ |
439 |
{ |
| 452 |
if (m_private->isReceiver()) { |
|
|
| 453 |
glBindTexture(GL_TEXTURE_2D, platformGetTextureID()); |
| 454 |
// Release previous lock and rebind texture to surface to get frame update. |
| 455 |
pGlXReleaseTexImageEXT(m_private->display(), m_private->glxPixmap(), GLX_FRONT_EXT); |
| 456 |
pGlXBindTexImageEXT(m_private->display(), m_private->glxPixmap(), GLX_FRONT_EXT, 0); |
| 457 |
return 0; |
| 458 |
} |
| 459 |
|
| 460 |
m_private->swapBuffers(); |
440 |
m_private->swapBuffers(); |
| 461 |
return 0; |
441 |
return 0; |
| 462 |
} |
442 |
} |