Commit 771d61a8 authored by Alexandre Julliard's avatar Alexandre Julliard

winex11: Use ExtEscape to flush the GL drawable to the physdev.

Based on a patch by Chris Robinson.
parent 235532ce
......@@ -436,6 +436,9 @@ INT X11DRV_ExtEscape( X11DRV_PDEVICE *physDev, INT escape, INT in_count, LPCVOID
return TRUE;
}
return FALSE;
case X11DRV_FLUSH_GL_DRAWABLE:
flush_gl_drawable(physDev);
return TRUE;
}
}
break;
......
......@@ -1967,7 +1967,7 @@ static void WINAPI X11DRV_wglGetIntegerv(GLenum pname, GLint* params)
wine_tsx11_unlock();
}
static inline void update_drawable(X11DRV_PDEVICE *physDev)
void flush_gl_drawable(X11DRV_PDEVICE *physDev)
{
int w, h;
......@@ -1983,9 +1983,11 @@ static inline void update_drawable(X11DRV_PDEVICE *physDev)
/* The GL drawable may be lagged behind if we don't flush first, so
* flush the display make sure we copy up-to-date data */
wine_tsx11_lock();
XFlush(gdi_display);
XCopyArea(gdi_display, src, physDev->drawable, physDev->gc, 0, 0, w, h,
physDev->dc_rect.left, physDev->dc_rect.top);
wine_tsx11_unlock();
}
}
......@@ -1993,23 +1995,25 @@ static inline void update_drawable(X11DRV_PDEVICE *physDev)
static void WINAPI X11DRV_wglFinish(void)
{
Wine_GLContext *ctx = NtCurrentTeb()->glContext;
enum x11drv_escape_codes code = X11DRV_FLUSH_GL_DRAWABLE;
wine_tsx11_lock();
sync_context(ctx);
pglFinish();
update_drawable(ctx->physDev);
wine_tsx11_unlock();
ExtEscape(ctx->hdc, X11DRV_ESCAPE, sizeof(code), (LPSTR)&code, 0, NULL );
}
static void WINAPI X11DRV_wglFlush(void)
{
Wine_GLContext *ctx = NtCurrentTeb()->glContext;
enum x11drv_escape_codes code = X11DRV_FLUSH_GL_DRAWABLE;
wine_tsx11_lock();
sync_context(ctx);
pglFlush();
update_drawable(ctx->physDev);
wine_tsx11_unlock();
ExtEscape(ctx->hdc, X11DRV_ESCAPE, sizeof(code), (LPSTR)&code, 0, NULL );
}
/**
......@@ -3292,7 +3296,8 @@ BOOL X11DRV_SwapBuffers(X11DRV_PDEVICE *physDev)
}
else
pglXSwapBuffers(gdi_display, drawable);
update_drawable(physDev);
flush_gl_drawable(physDev);
wine_tsx11_unlock();
/* FPS support */
......@@ -3375,6 +3380,10 @@ void mark_drawable_dirty(Drawable old, Drawable new)
{
}
void flush_gl_drawable(X11DRV_PDEVICE *physDev)
{
}
Drawable create_glxpixmap(Display *display, XVisualInfo *vis, Pixmap parent)
{
return 0;
......
......@@ -477,7 +477,8 @@ enum x11drv_escape_codes
X11DRV_GET_DCE, /* get the DCE pointer */
X11DRV_SET_DCE, /* set the DCE pointer */
X11DRV_GET_GLX_DRAWABLE, /* get current glx drawable for a DC */
X11DRV_SYNC_PIXMAP /* sync the dibsection to its pixmap */
X11DRV_SYNC_PIXMAP, /* sync the dibsection to its pixmap */
X11DRV_FLUSH_GL_DRAWABLE /* flush changes made to the gl drawable */
};
struct x11drv_escape_set_drawable
......@@ -676,6 +677,7 @@ extern int pixelformat_from_fbconfig_id( XID fbconfig_id );
extern XVisualInfo *visual_from_fbconfig_id( XID fbconfig_id );
extern void mark_drawable_dirty( Drawable old, Drawable new );
extern Drawable create_glxpixmap( Display *display, XVisualInfo *vis, Pixmap parent );
extern void flush_gl_drawable( X11DRV_PDEVICE *physDev );
extern void alloc_window_dce( struct x11drv_win_data *data );
extern void free_window_dce( struct x11drv_win_data *data );
......
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