Commit a403d948 authored by Sam Lantinga's avatar Sam Lantinga

If scaling isn't supported, do an unscaled copy instead of not showing anything.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403288
parent a5471290
...@@ -646,28 +646,21 @@ X11_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, ...@@ -646,28 +646,21 @@ X11_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
if (data->makedirty) { if (data->makedirty) {
SDL_AddDirtyRect(&data->dirty, dstrect); SDL_AddDirtyRect(&data->dirty, dstrect);
} }
if (srcrect->w == dstrect->w && srcrect->h == dstrect->h) {
#ifndef NO_SHARED_MEMORY #ifndef NO_SHARED_MEMORY
if (texturedata->shminfo.shmaddr) { if (texturedata->shminfo.shmaddr) {
XShmPutImage(data->display, data->drawable, data->gc, XShmPutImage(data->display, data->drawable, data->gc,
texturedata->image, srcrect->x, srcrect->y, texturedata->image, srcrect->x, srcrect->y, dstrect->x,
dstrect->x, dstrect->y, dstrect->w, dstrect->h, dstrect->y, srcrect->w, srcrect->h, False);
False);
} else } else
#endif #endif
if (texturedata->pixels) { if (texturedata->pixels) {
XPutImage(data->display, data->drawable, data->gc, XPutImage(data->display, data->drawable, data->gc, texturedata->image,
texturedata->image, srcrect->x, srcrect->y, dstrect->x, srcrect->x, srcrect->y, dstrect->x, dstrect->y, srcrect->w,
dstrect->y, dstrect->w, dstrect->h); srcrect->h);
} else { } else {
XCopyArea(data->display, texturedata->pixmap, data->drawable, XCopyArea(data->display, texturedata->pixmap, data->drawable,
data->gc, srcrect->x, srcrect->y, dstrect->w, data->gc, srcrect->x, srcrect->y, dstrect->w, dstrect->h,
dstrect->h, dstrect->x, dstrect->y); srcrect->x, srcrect->y);
}
} else {
SDL_SetError("Scaling not supported in the X11 renderer");
return -1;
} }
return 0; return 0;
} }
......
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