summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSam Lantinga <slouken@libsdl.org>2008-12-03 11:09:58 +0000
committerSam Lantinga <slouken@libsdl.org>2008-12-03 11:09:58 +0000
commit4888e23002010162746ee9147e0d5fbd201edb9f (patch)
tree203c608c45316119498c36a4710099b6d6a8e25f /src
parent36bf69e93492f4b74873cb40a6a88453711c02b4 (diff)
If scaling isn't supported, do an unscaled copy instead of not showing anything.
Diffstat (limited to 'src')
-rw-r--r--src/video/x11/SDL_x11render.c31
1 files changed, 12 insertions, 19 deletions
diff --git a/src/video/x11/SDL_x11render.c b/src/video/x11/SDL_x11render.c
index f6183091cf..833e29afc1 100644
--- a/src/video/x11/SDL_x11render.c
+++ b/src/video/x11/SDL_x11render.c
@@ -646,28 +646,21 @@ X11_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
if (data->makedirty) {
SDL_AddDirtyRect(&data->dirty, dstrect);
}
-
- if (srcrect->w == dstrect->w && srcrect->h == dstrect->h) {
#ifndef NO_SHARED_MEMORY
- if (texturedata->shminfo.shmaddr) {
- XShmPutImage(data->display, data->drawable, data->gc,
- texturedata->image, srcrect->x, srcrect->y,
- dstrect->x, dstrect->y, dstrect->w, dstrect->h,
- False);
- } else
+ if (texturedata->shminfo.shmaddr) {
+ XShmPutImage(data->display, data->drawable, data->gc,
+ texturedata->image, srcrect->x, srcrect->y, dstrect->x,
+ dstrect->y, srcrect->w, srcrect->h, False);
+ } else
#endif
- if (texturedata->pixels) {
- XPutImage(data->display, data->drawable, data->gc,
- texturedata->image, srcrect->x, srcrect->y, dstrect->x,
- dstrect->y, dstrect->w, dstrect->h);
- } else {
- XCopyArea(data->display, texturedata->pixmap, data->drawable,
- data->gc, srcrect->x, srcrect->y, dstrect->w,
- dstrect->h, dstrect->x, dstrect->y);
- }
+ if (texturedata->pixels) {
+ XPutImage(data->display, data->drawable, data->gc, texturedata->image,
+ srcrect->x, srcrect->y, dstrect->x, dstrect->y, srcrect->w,
+ srcrect->h);
} else {
- SDL_SetError("Scaling not supported in the X11 renderer");
- return -1;
+ XCopyArea(data->display, texturedata->pixmap, data->drawable,
+ data->gc, srcrect->x, srcrect->y, dstrect->w, dstrect->h,
+ srcrect->x, srcrect->y);
}
return 0;
}