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

This commit is contained in:
Alexandre Julliard 2008-05-28 17:52:06 +02:00
parent ed37174a71
commit 2d9b38133b
4 changed files with 14 additions and 3 deletions

View file

@ -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();

View file

@ -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;

View file

@ -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;
}

View file

@ -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 */
};
/**************************************************************************