comparison src/video/x11/SDL_x11render.c @ 4608:ff7b00d4b0d3

Fix X11_DisplayModeChanged.
author Sunny Sachanandani <sunnysachanandani@gmail.com>
date Wed, 21 Jul 2010 18:33:13 +0530
parents 9e9ec5e3be95
children 630002c8be85
comparison
equal deleted inserted replaced
4607:9e9ec5e3be95 4608:ff7b00d4b0d3
552 int i, n; 552 int i, n;
553 553
554 #ifdef SDL_VIDEO_DRIVER_X11_XRENDER 554 #ifdef SDL_VIDEO_DRIVER_X11_XRENDER
555 if (data->use_xrender) { 555 if (data->use_xrender) {
556 XRenderFreePicture(data->display, data->xwindow_pict); 556 XRenderFreePicture(data->display, data->xwindow_pict);
557
557 data->xwindow_pict_fmt = 558 data->xwindow_pict_fmt =
558 XRenderFindVisualFormat(data->display, data->visual); 559 XRenderFindVisualFormat(data->display, data->visual);
559 data->xwindow_pict = 560 data->xwindow_pict =
560 XRenderCreatePicture(data->display, data->xwindow, 561 XRenderCreatePicture(data->display, data->xwindow,
561 data->xwindow_pict_fmt, 0, NULL); 562 data->xwindow_pict_fmt, 0, NULL);
563
564 XRenderComposite(data->display,
565 PictOpClear,
566 data->xwindow_pict,
567 None,
568 data->xwindow_pict,
569 0, 0,
570 0, 0,
571 0, 0,
572 window->w, window->h);
573
574 XFreePixmap(data->display, data->stencil);
575 /* Create a clip mask that is used for rendering primitives. */
576 data->stencil = XCreatePixmap(data->display, data->xwindow,
577 window->w, window->h, 32);
578
579 XRenderFreePicture(data->display, data->stencil_pict);
580 data->stencil_pict =
581 XRenderCreatePicture(data->display, data->stencil,
582 XRenderFindStandardFormat(data->display,
583 PictStandardARGB32),
584 0, NULL);
585 #ifdef SDL_VIDEO_DRIVER_X11_XDAMAGE
586 XDamageDestroy(data->display, data->stencil_damage);
587 if (data->use_xdamage) {
588 data->stencil_damage =
589 XDamageCreate(data->display, data->stencil, XDamageReportNonEmpty);
590 XDamageSubtract(data->display, data->stencil_damage, None, data->stencil_parts);
591 }
592 #endif
562 } 593 }
563 #endif 594 #endif
564 if (renderer->info.flags & SDL_RENDERER_SINGLEBUFFER) { 595 if (renderer->info.flags & SDL_RENDERER_SINGLEBUFFER) {
565 n = 0; 596 n = 0;
566 } else if (renderer->info.flags & SDL_RENDERER_PRESENTFLIP2) { 597 } else if (renderer->info.flags & SDL_RENDERER_PRESENTFLIP2) {