comparison src/video/x11/SDL_x11render.c @ 2827:aec4399c507a

If scaling isn't supported, do an unscaled copy instead of not showing anything.
author Sam Lantinga <slouken@libsdl.org>
date Wed, 03 Dec 2008 11:09:58 +0000
parents e841aa93e6be
children 7e5ff6cd05bf
comparison
equal deleted inserted replaced
2826:cd4a49d5c1ba 2827:aec4399c507a
644 X11_TextureData *texturedata = (X11_TextureData *) texture->driverdata; 644 X11_TextureData *texturedata = (X11_TextureData *) texture->driverdata;
645 645
646 if (data->makedirty) { 646 if (data->makedirty) {
647 SDL_AddDirtyRect(&data->dirty, dstrect); 647 SDL_AddDirtyRect(&data->dirty, dstrect);
648 } 648 }
649
650 if (srcrect->w == dstrect->w && srcrect->h == dstrect->h) {
651 #ifndef NO_SHARED_MEMORY 649 #ifndef NO_SHARED_MEMORY
652 if (texturedata->shminfo.shmaddr) { 650 if (texturedata->shminfo.shmaddr) {
653 XShmPutImage(data->display, data->drawable, data->gc, 651 XShmPutImage(data->display, data->drawable, data->gc,
654 texturedata->image, srcrect->x, srcrect->y, 652 texturedata->image, srcrect->x, srcrect->y, dstrect->x,
655 dstrect->x, dstrect->y, dstrect->w, dstrect->h, 653 dstrect->y, srcrect->w, srcrect->h, False);
656 False); 654 } else
657 } else
658 #endif 655 #endif
659 if (texturedata->pixels) { 656 if (texturedata->pixels) {
660 XPutImage(data->display, data->drawable, data->gc, 657 XPutImage(data->display, data->drawable, data->gc, texturedata->image,
661 texturedata->image, srcrect->x, srcrect->y, dstrect->x, 658 srcrect->x, srcrect->y, dstrect->x, dstrect->y, srcrect->w,
662 dstrect->y, dstrect->w, dstrect->h); 659 srcrect->h);
663 } else { 660 } else {
664 XCopyArea(data->display, texturedata->pixmap, data->drawable, 661 XCopyArea(data->display, texturedata->pixmap, data->drawable,
665 data->gc, srcrect->x, srcrect->y, dstrect->w, 662 data->gc, srcrect->x, srcrect->y, dstrect->w, dstrect->h,
666 dstrect->h, dstrect->x, dstrect->y); 663 srcrect->x, srcrect->y);
667 }
668 } else {
669 SDL_SetError("Scaling not supported in the X11 renderer");
670 return -1;
671 } 664 }
672 return 0; 665 return 0;
673 } 666 }
674 667
675 static void 668 static void