Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fix X11_DisplayModeChanged.
Browse files Browse the repository at this point in the history
  • Loading branch information
sunnyps committed Jul 21, 2010
1 parent 4b32f5b commit 847d910
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/video/x11/SDL_x11render.c
Expand Up @@ -554,11 +554,42 @@ X11_DisplayModeChanged(SDL_Renderer * renderer)
#ifdef SDL_VIDEO_DRIVER_X11_XRENDER
if (data->use_xrender) {
XRenderFreePicture(data->display, data->xwindow_pict);

data->xwindow_pict_fmt =
XRenderFindVisualFormat(data->display, data->visual);
data->xwindow_pict =
XRenderCreatePicture(data->display, data->xwindow,
data->xwindow_pict_fmt, 0, NULL);

XRenderComposite(data->display,
PictOpClear,
data->xwindow_pict,
None,
data->xwindow_pict,
0, 0,
0, 0,
0, 0,
window->w, window->h);

XFreePixmap(data->display, data->stencil);
/* Create a clip mask that is used for rendering primitives. */
data->stencil = XCreatePixmap(data->display, data->xwindow,
window->w, window->h, 32);

XRenderFreePicture(data->display, data->stencil_pict);
data->stencil_pict =
XRenderCreatePicture(data->display, data->stencil,
XRenderFindStandardFormat(data->display,
PictStandardARGB32),
0, NULL);
#ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE
XDamageDestroy(data->display, data->stencil_damage);
if (data->use_xdamage) {
data->stencil_damage =
XDamageCreate(data->display, data->stencil, XDamageReportNonEmpty);
XDamageSubtract(data->display, data->stencil_damage, None, data->stencil_parts);
}
#endif
}
#endif
if (renderer->info.flags & SDL_RENDERER_SINGLEBUFFER) {
Expand Down

0 comments on commit 847d910

Please sign in to comment.