winex11: Store a GL-specific drawable with the window.

This commit is contained in:
Chris Robinson 2007-09-25 10:20:58 -07:00 committed by Alexandre Julliard
parent 00bc3d9e48
commit a8124f97e6
5 changed files with 25 additions and 0 deletions

View File

@ -151,11 +151,13 @@ static void update_visible_region( struct dce *dce )
{
escape.drawable = data->icon_window;
escape.fbconfig_id = 0;
escape.gl_drawable = 0;
}
else
{
escape.drawable = X11DRV_get_whole_window( top );
escape.fbconfig_id = X11DRV_get_fbconfig_id( dce->hwnd );
escape.gl_drawable = X11DRV_get_gl_drawable( dce->hwnd );
}
escape.code = X11DRV_SET_DRAWABLE;
@ -192,6 +194,7 @@ static void release_dce( struct dce *dce )
SetRect( &escape.dc_rect, 0, 0, virtual_screen_rect.right - virtual_screen_rect.left,
virtual_screen_rect.bottom - virtual_screen_rect.top );
escape.fbconfig_id = 0;
escape.gl_drawable = 0;
ExtEscape( dce->hdc, X11DRV_ESCAPE, sizeof(escape), (LPSTR)&escape, 0, NULL );
}

View File

@ -341,6 +341,7 @@ INT X11DRV_ExtEscape( X11DRV_PDEVICE *physDev, INT escape, INT in_count, LPCVOID
physDev->drawable = data->drawable;
physDev->drawable_rect = data->drawable_rect;
physDev->current_pf = pixelformat_from_fbconfig_id( data->fbconfig_id );
physDev->gl_drawable = data->gl_drawable;
wine_tsx11_lock();
XSetSubwindowMode( gdi_display, physDev->gc, data->mode );
wine_tsx11_unlock();

View File

@ -3308,6 +3308,8 @@ Drawable get_glxdrawable(X11DRV_PDEVICE *physDev)
ret = physDev->bitmap->glxpixmap;
}
}
else if(physDev->gl_drawable)
ret = physDev->gl_drawable;
else
ret = physDev->drawable;
return ret;

View File

@ -56,6 +56,7 @@ static XContext win_data_context;
static const char whole_window_prop[] = "__wine_x11_whole_window";
static const char icon_window_prop[] = "__wine_x11_icon_window";
static const char fbconfig_id_prop[] = "__wine_x11_fbconfig_id";
static const char gl_drawable_prop[] = "__wine_x11_gl_drawable";
static const char managed_prop[] = "__wine_x11_managed";
static const char visual_id_prop[] = "__wine_x11_visual_id";
@ -955,6 +956,7 @@ static struct x11drv_win_data *alloc_win_data( Display *display, HWND hwnd )
data->whole_window = 0;
data->icon_window = 0;
data->fbconfig_id = 0;
data->gl_drawable = 0;
data->xic = 0;
data->managed = FALSE;
data->dce = NULL;
@ -1260,6 +1262,19 @@ XID X11DRV_get_fbconfig_id( HWND hwnd )
return data->fbconfig_id;
}
/***********************************************************************
* X11DRV_get_gl_drawable
*
* Return the GL drawable for this window.
*/
Drawable X11DRV_get_gl_drawable( HWND hwnd )
{
struct x11drv_win_data *data = X11DRV_get_win_data( hwnd );
if (!data) return (Drawable)GetPropA( hwnd, gl_drawable_prop );
return data->gl_drawable;
}
/***********************************************************************
* X11DRV_get_ic

View File

@ -139,6 +139,7 @@ typedef struct
int exposures; /* count of graphics exposures operations */
struct dce *dce; /* opaque pointer to DCE */
int current_pf;
Drawable gl_drawable;
XRENDERINFO xrender;
} X11DRV_PDEVICE;
@ -486,6 +487,7 @@ struct x11drv_escape_set_drawable
RECT dc_rect; /* DC rectangle relative to drawable */
RECT drawable_rect;/* Drawable rectangle relative to screen */
XID fbconfig_id; /* fbconfig id used by the GL drawable */
Drawable gl_drawable; /* GL drawable */
};
struct x11drv_escape_set_dce
@ -645,6 +647,7 @@ struct x11drv_win_data
Window whole_window; /* X window for the complete window */
Window icon_window; /* X window for the icon */
XID fbconfig_id; /* fbconfig id for the GL drawable this hwnd uses */
Drawable gl_drawable; /* Optional GL drawable for rendering the client area */
RECT window_rect; /* USER window rectangle relative to parent */
RECT whole_rect; /* X window rectangle for the whole window relative to parent */
RECT client_rect; /* client area relative to whole window */
@ -660,6 +663,7 @@ struct x11drv_win_data
extern struct x11drv_win_data *X11DRV_get_win_data( HWND hwnd );
extern Window X11DRV_get_whole_window( HWND hwnd );
extern XID X11DRV_get_fbconfig_id( HWND hwnd );
extern Drawable X11DRV_get_gl_drawable( HWND hwnd );
extern BOOL X11DRV_is_window_rect_mapped( const RECT *rect );
extern XIC X11DRV_get_ic( HWND hwnd );
extern BOOL X11DRV_set_win_format( HWND hwnd, XID fbconfig );