Commit 2d9b3813 authored by Alexandre Julliard's avatar Alexandre Julliard

winex11: Add support for performing GL calls on a top-level window DC.

parent ed37174a
......@@ -342,6 +342,7 @@ INT X11DRV_ExtEscape( X11DRV_PDEVICE *physDev, INT escape, INT in_count, LPCVOID
physDev->current_pf = pixelformat_from_fbconfig_id( data->fbconfig_id );
physDev->gl_drawable = data->gl_drawable;
physDev->pixmap = data->pixmap;
physDev->gl_copy = data->gl_copy;
wine_tsx11_lock();
XSetSubwindowMode( gdi_display, physDev->gc, data->mode );
wine_tsx11_unlock();
......
......@@ -2112,7 +2112,7 @@ void flush_gl_drawable(X11DRV_PDEVICE *physDev)
{
int w, h;
if(!physDev->gl_drawable)
if (!physDev->gl_copy)
return;
w = physDev->dc_rect.right - physDev->dc_rect.left;
......
......@@ -1747,14 +1747,21 @@ void X11DRV_GetDC( HDC hdc, HWND hwnd, HWND top, const RECT *win_rect,
escape.fbconfig_id = 0;
escape.gl_drawable = 0;
escape.pixmap = 0;
escape.gl_copy = FALSE;
if (top == hwnd && data && IsIconic( hwnd ) && data->icon_window)
{
escape.drawable = data->icon_window;
}
else if (top == hwnd && (flags & DCX_WINDOW))
else if (top == hwnd)
{
escape.drawable = data ? data->whole_window : X11DRV_get_whole_window( hwnd );
escape.fbconfig_id = data ? data->fbconfig_id : (XID)GetPropA( hwnd, fbconfig_id_prop );
/* GL draws to the client area even for window DCs */
escape.gl_drawable = data ? data->client_window : X11DRV_get_client_window( hwnd );
if (flags & DCX_WINDOW)
escape.drawable = data ? data->whole_window : X11DRV_get_whole_window( hwnd );
else
escape.drawable = escape.gl_drawable;
}
else
{
......@@ -1762,6 +1769,7 @@ void X11DRV_GetDC( HDC hdc, HWND hwnd, HWND top, const RECT *win_rect,
escape.fbconfig_id = data ? data->fbconfig_id : (XID)GetPropA( hwnd, fbconfig_id_prop );
escape.gl_drawable = data ? data->gl_drawable : (Drawable)GetPropA( hwnd, gl_drawable_prop );
escape.pixmap = data ? data->pixmap : (Pixmap)GetPropA( hwnd, pixmap_prop );
escape.gl_copy = (escape.gl_drawable != 0);
if (flags & DCX_CLIPCHILDREN) escape.mode = ClipByChildren;
}
......
......@@ -139,6 +139,7 @@ typedef struct
int current_pf;
Drawable gl_drawable;
Pixmap pixmap; /* Pixmap for a GLXPixmap gl_drawable */
int gl_copy;
XRENDERINFO xrender;
} X11DRV_PDEVICE;
......@@ -497,6 +498,7 @@ struct x11drv_escape_set_drawable
XID fbconfig_id; /* fbconfig id used by the GL drawable */
Drawable gl_drawable; /* GL drawable */
Pixmap pixmap; /* Pixmap for a GLXPixmap gl_drawable */
int gl_copy; /* whether the GL contents need explicit copying */
};
/**************************************************************************
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment