Mercurial > sdl-ios-xcode
comparison src/video/x11/SDL_x11render.c @ 4594:f28c23cc1a08
Remove some redundant code.
author | Sunny Sachanandani <sunnysachanandani@gmail.com> |
---|---|
date | Sat, 17 Jul 2010 15:41:34 +0530 |
parents | 3892fe2f6537 |
children | 73eeadf7ed8e |
comparison
equal
deleted
inserted
replaced
4593:3892fe2f6537 | 4594:f28c23cc1a08 |
---|---|
1441 XRenderComposite(data->display, texturedata->blend_op, texturedata->picture, | 1441 XRenderComposite(data->display, texturedata->blend_op, texturedata->picture, |
1442 pict, data->drawable_pict, srcrect->x, srcrect->y, | 1442 pict, data->drawable_pict, srcrect->x, srcrect->y, |
1443 srcrect->x, srcrect->y, dstrect->x, dstrect->y, | 1443 srcrect->x, srcrect->y, dstrect->x, dstrect->y, |
1444 srcrect->w, srcrect->h); | 1444 srcrect->w, srcrect->h); |
1445 } else { | 1445 } else { |
1446 /*Pixmap scaling_pixmap = | |
1447 XCreatePixmap(data->display, texturedata->pixmap, dstrect->w, dstrect->h, | |
1448 data->depth); | |
1449 if (!scaling_pixmap) { | |
1450 SDL_SetError("XCreatePixmap() failed"); | |
1451 return -1; | |
1452 } | |
1453 Picture scaling_picture = | |
1454 XRenderCreatePicture(data->display, scaling_pixmap, texturedata->picture_fmt, | |
1455 0, NULL); | |
1456 if (!scaling_picture) { | |
1457 SDL_SetError("XRenderCreatePicture() failed"); | |
1458 return -1; | |
1459 } | |
1460 XRenderComposite(data->display, PictOpClear, scaling_picture, None, scaling_picture, | |
1461 0, 0, 0, 0, 0, 0, dstrect->w, dstrect->h); | |
1462 XRenderComposite(data->display, PictOpSrc, texturedata->picture, pict, scaling_picture, | |
1463 srcrect->x, srcrect->y, 0, 0, 0, 0, srcrect->w, srcrect->h);*/ | |
1464 double xscale = ((double) dstrect->w) / srcrect->w; | 1446 double xscale = ((double) dstrect->w) / srcrect->w; |
1465 double yscale = ((double) dstrect->h) / srcrect->h; | 1447 double yscale = ((double) dstrect->h) / srcrect->h; |
1466 XTransform xform = {{ | 1448 XTransform xform = {{ |
1467 {XDoubleToFixed(xscale), XDoubleToFixed(0), XDoubleToFixed(0)}, | 1449 {XDoubleToFixed(xscale), XDoubleToFixed(0), XDoubleToFixed(0)}, |
1468 {XDoubleToFixed(0), XDoubleToFixed(yscale), XDoubleToFixed(0)}, | 1450 {XDoubleToFixed(0), XDoubleToFixed(yscale), XDoubleToFixed(0)}, |
1477 XTransform identity = {{ | 1459 XTransform identity = {{ |
1478 {XDoubleToFixed(1), XDoubleToFixed(0), XDoubleToFixed(0)}, | 1460 {XDoubleToFixed(1), XDoubleToFixed(0), XDoubleToFixed(0)}, |
1479 {XDoubleToFixed(0), XDoubleToFixed(1), XDoubleToFixed(0)}, | 1461 {XDoubleToFixed(0), XDoubleToFixed(1), XDoubleToFixed(0)}, |
1480 {XDoubleToFixed(0), XDoubleToFixed(0), XDoubleToFixed(1)}}}; | 1462 {XDoubleToFixed(0), XDoubleToFixed(0), XDoubleToFixed(1)}}}; |
1481 XRenderSetPictureTransform(data->display, texturedata->picture, &identity); | 1463 XRenderSetPictureTransform(data->display, texturedata->picture, &identity); |
1482 | |
1483 /*XRenderFreePicture(data->display, scaling_picture); | |
1484 XFreePixmap(data->display, scaling_pixmap);*/ | |
1485 } | 1464 } |
1486 } | 1465 } |
1487 else | 1466 else |
1488 #endif | 1467 #endif |
1489 { | 1468 { |